Class ServiceInstancesResolver
Queries all discovery clients for service instances, optionally caching the results using
Inheritance
System.Object
ServiceInstancesResolver
Namespace: Steeltoe.Discovery.HttpClients.LoadBalancers
Assembly: Steeltoe.Discovery.HttpClients.dll
Syntax
public sealed class ServiceInstancesResolver : object
Constructors
| Edit this page View SourceServiceInstancesResolver(IEnumerable<IDiscoveryClient>, ILogger<ServiceInstancesResolver>)
Initializes a new instance of the ServiceInstancesResolver class.
Declaration
public ServiceInstancesResolver(IEnumerable<IDiscoveryClient> discoveryClients, ILogger<ServiceInstancesResolver> logger)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<IDiscoveryClient> | discoveryClients | Used to retrieve the available service instances. |
ILogger<ServiceInstancesResolver> | logger | Used for internal logging. Pass |
ServiceInstancesResolver(IEnumerable<IDiscoveryClient>, Nullable<IDistributedCache>, Nullable<DistributedCacheEntryOptions>, ILogger<ServiceInstancesResolver>)
Initializes a new instance of the ServiceInstancesResolver class.
Declaration
public ServiceInstancesResolver(IEnumerable<IDiscoveryClient> discoveryClients, IDistributedCache? distributedCache, DistributedCacheEntryOptions? cacheEntryOptions, ILogger<ServiceInstancesResolver> logger)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<IDiscoveryClient> | discoveryClients | Used to retrieve the available service instances. |
System.Nullable<IDistributedCache> | distributedCache | For caching the service instances. |
System.Nullable<DistributedCacheEntryOptions> | cacheEntryOptions | Configuration for |
ILogger<ServiceInstancesResolver> | logger | Used for internal logging. Pass |
Methods
| Edit this page View SourceResolveInstancesAsync(String, CancellationToken)
Declaration
public async Task<IList<IServiceInstance>> ResolveInstancesAsync(string serviceId, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
System.String | serviceId | |
CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
Task<IList<IServiceInstance>> |