Class LocatorLocationResolver
Implements ILocationResolver using an ILocator.
public class LocatorLocationResolver : ILocationResolver
- Inheritance
-
LocatorLocationResolver
- Implements
- Inherited Members
Constructors
LocatorLocationResolver(ILocator, LocatorOptions, ILogger)
Constructs a locator location resolver.
public LocatorLocationResolver(ILocator locator, LocatorOptions options, ILogger logger)
Parameters
locatorILocatorThe locator.
optionsLocatorOptionsThe locator options.
loggerILoggerThe logger.
Methods
ResolveAsync(Location, bool, CancellationToken)
Resolves a location into one or more server addresses carried by a dummy service address.
public 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.