Interface ILoadBalancer
Namespace: Steeltoe.Discovery.HttpClients.LoadBalancers
Assembly: Steeltoe.Discovery.HttpClients.dll
Syntax
public interface ILoadBalancer
Methods
| Edit this page View SourceResolveServiceInstanceAsync(Uri, CancellationToken)
Evaluates a URI for a hostname that can be resolved into a service instance.
Declaration
Task<Uri> ResolveServiceInstanceAsync(Uri requestUri, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
Uri | requestUri | A URI containing a service name that can be resolved into one or more service instances. |
CancellationToken | cancellationToken | The token to monitor for cancellation requests. |
Returns
Type | Description |
---|---|
Task<Uri> | The original URI, with the scheme and service name replaced by the scheme, host and port of a service instance. |
UpdateStatisticsAsync(Uri, Uri, Nullable<TimeSpan>, Nullable<Exception>, CancellationToken)
A mechanism for tracking statistics for service instances.
Declaration
Task UpdateStatisticsAsync(Uri requestUri, Uri serviceInstanceUri, TimeSpan? responseTime, Exception? exception, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
Uri | requestUri | The original request URI. |
Uri | serviceInstanceUri | The URI resolved by the load balancer. |
System.Nullable<TimeSpan> | responseTime | The amount of time taken for a remote call to complete. |
System.Nullable<Exception> | exception | Any exception thrown during calls to a resolved service instance. |
CancellationToken | cancellationToken | The token to monitor for cancellation requests. |
Returns
Type | Description |
---|---|
Task |