Class RoundRobinLoadBalancer
- Namespace
- Steeltoe.Common.LoadBalancer
- Assembly
- Steeltoe.Common.dll
public class RoundRobinLoadBalancer : ILoadBalancer
- Inheritance
-
RoundRobinLoadBalancer
- Implements
- Inherited Members
Constructors
RoundRobinLoadBalancer(IServiceInstanceProvider, IDistributedCache, DistributedCacheEntryOptions, ILogger)
public RoundRobinLoadBalancer(IServiceInstanceProvider serviceInstanceProvider, IDistributedCache distributedCache = null, DistributedCacheEntryOptions cacheEntryOptions = null, ILogger logger = null)
Parameters
serviceInstanceProvider
IServiceInstanceProviderdistributedCache
IDistributedCachecacheEntryOptions
DistributedCacheEntryOptionslogger
ILogger
Fields
IndexKeyPrefix
public string IndexKeyPrefix
Field Value
Methods
ResolveServiceInstanceAsync(Uri)
Evaluates a URI for a host name that can be resolved into a service instance
public virtual Task<Uri> ResolveServiceInstanceAsync(Uri request)
Parameters
request
UriA URI containing a service name that can be resolved into one or more service instances
Returns
UpdateStatsAsync(Uri, Uri, TimeSpan, Exception)
A mechanism for tracking statistics for service instances
public virtual Task UpdateStatsAsync(Uri originalUri, Uri resolvedUri, TimeSpan responseTime, Exception exception)
Parameters
originalUri
UriThe original request URI
resolvedUri
UriThe URI resolved by the load balancer
responseTime
TimeSpanThe amount of time taken for a remote call to complete
exception
ExceptionAny exception called during calls to a resolved service instance
Returns
- Task
A task