Interface ILocationResolver
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
locationLocationThe location to resolve.
refreshCacheboolWhen true, requests a cache refresh.
cancellationTokenCancellationTokenThe 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 the resolution was served from the implementation's cache: true when the location lookup — or, for a well-known service address carrying an adapter ID, the recursive adapter ID lookup — was served from the cache, in which case requesting a cache refresh on a retry can produce a different resolution. ServiceAddress is null when the location resolver fails to resolve a location. When ServiceAddress is not null, its ServerAddress is not null.