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
locator
ILocatorThe locator.
options
LocatorOptionsThe locator options.
logger
ILoggerThe 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
location
LocationThe location to resolve.
refreshCache
boolWhen true, requests a cache refresh.
cancellationToken
CancellationTokenThe 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.