Class ServiceInstancesResolver
- Namespace
- Steeltoe.Discovery.HttpClients.LoadBalancers
- Assembly
- Steeltoe.Discovery.HttpClients.dll
Queries all discovery clients for service instances, optionally caching the results using IDistributedCache.
public sealed class ServiceInstancesResolver
- Inheritance
-
ServiceInstancesResolver
- Inherited Members
Constructors
ServiceInstancesResolver(IEnumerable<IDiscoveryClient>, IDistributedCache?, DistributedCacheEntryOptions?, ILogger<ServiceInstancesResolver>)
Initializes a new instance of the ServiceInstancesResolver class.
public ServiceInstancesResolver(IEnumerable<IDiscoveryClient> discoveryClients, IDistributedCache? distributedCache, DistributedCacheEntryOptions? cacheEntryOptions, ILogger<ServiceInstancesResolver> logger)
Parameters
discoveryClients
IEnumerable<IDiscoveryClient>Used to retrieve the available service instances.
distributedCache
IDistributedCacheFor caching the service instances.
cacheEntryOptions
DistributedCacheEntryOptionsConfiguration for
distributedCache
.logger
ILogger<ServiceInstancesResolver>Used for internal logging. Pass Instance to disable logging.
ServiceInstancesResolver(IEnumerable<IDiscoveryClient>, ILogger<ServiceInstancesResolver>)
Initializes a new instance of the ServiceInstancesResolver class.
public ServiceInstancesResolver(IEnumerable<IDiscoveryClient> discoveryClients, ILogger<ServiceInstancesResolver> logger)
Parameters
discoveryClients
IEnumerable<IDiscoveryClient>Used to retrieve the available service instances.
logger
ILogger<ServiceInstancesResolver>Used for internal logging. Pass Instance to disable logging.
Methods
ResolveInstancesAsync(string, CancellationToken)
public Task<IList<IServiceInstance>> ResolveInstancesAsync(string serviceId, CancellationToken cancellationToken)
Parameters
serviceId
stringcancellationToken
CancellationToken