Table of Contents

Interface ILocationResolver

Namespace
IceRpc.Locator
Assembly
IceRpc.Locator.dll

A location resolver resolves a location into one or more server addresses carried by a dummy service address, and optionally maintains a cache for these resolutions. It's the "brain" of LocatorInterceptor. The same location resolver can be shared by multiple locator interceptors.

public interface ILocationResolver

Methods

ResolveAsync(Location, bool, CancellationToken)

Resolves a location into one or more server addresses carried by a dummy service address.

ValueTask<(ServiceAddress? ServiceAddress, bool FromCache)> ResolveAsync(Location location, bool refreshCache, CancellationToken cancellationToken)

Parameters

location Location

The location to resolve.

refreshCache bool

When true, requests a cache refresh.

cancellationToken CancellationToken

The cancellation token.

Returns

ValueTask<(ServiceAddress ServiceAddress, bool FromCache)>

A tuple with a nullable dummy service address that holds the server addresses (if resolved), and a bool that indicates whether these server addresses were retrieved from the implementation's cache. ServiceAddress is null when the location resolver fails to resolve a location. When ServiceAddress is not null, its ServerAddress is not null.