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 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.