Class RandomLoadBalancer
Inheritance
System.Object
RandomLoadBalancer
Implements
Namespace: Steeltoe.Common.LoadBalancer
Assembly: Steeltoe.Common.dll
Syntax
public class RandomLoadBalancer : object, ILoadBalancer
Constructors
| Edit this page View SourceRandomLoadBalancer(IServiceInstanceProvider, IDistributedCache, DistributedCacheEntryOptions, ILogger)
Initializes a new instance of the RandomLoadBalancer class. Returns random service instances, with option caching of service lookups
Declaration
public RandomLoadBalancer(IServiceInstanceProvider serviceInstanceProvider, IDistributedCache distributedCache = null, DistributedCacheEntryOptions cacheEntryOptions = null, ILogger logger = null)
Parameters
Type | Name | Description |
---|---|---|
IServiceInstanceProvider | serviceInstanceProvider | Provider of service instance information |
IDistributedCache | distributedCache | For caching service instance data |
DistributedCacheEntryOptions | cacheEntryOptions | Configuration for cache entries of service instance data |
ILogger | logger | For logging |
Methods
| Edit this page View SourceResolveServiceInstanceAsync(Uri)
Declaration
public virtual async Task<Uri> ResolveServiceInstanceAsync(Uri request)
Parameters
Type | Name | Description |
---|---|---|
Uri | request |
Returns
Type | Description |
---|---|
Task<Uri> |
UpdateStatsAsync(Uri, Uri, TimeSpan, Exception)
Declaration
public virtual Task UpdateStatsAsync(Uri originalUri, Uri resolvedUri, TimeSpan responseTime, Exception exception)
Parameters
Type | Name | Description |
---|---|---|
Uri | originalUri | |
Uri | resolvedUri | |
TimeSpan | responseTime | |
Exception | exception |
Returns
Type | Description |
---|---|
Task |