Class DiscoveryHttpDelegatingHandler<TLoadBalancer>
- Namespace
- Steeltoe.Discovery.HttpClients
- Assembly
- Steeltoe.Discovery.HttpClients.dll
A DelegatingHandler that performs service discovery.
public sealed class DiscoveryHttpDelegatingHandler<TLoadBalancer> : DelegatingHandler, IDisposable where TLoadBalancer : class, ILoadBalancer
Type Parameters
TLoadBalancerThe type of load balancer to use.
- Inheritance
-
DiscoveryHttpDelegatingHandler<TLoadBalancer>
- Implements
- Inherited Members
Constructors
DiscoveryHttpDelegatingHandler(IServiceProvider, TimeProvider)
Initializes a new instance of the DiscoveryHttpDelegatingHandler<TLoadBalancer> class.
public DiscoveryHttpDelegatingHandler(IServiceProvider serviceProvider, TimeProvider timeProvider)
Parameters
serviceProviderIServiceProviderThe IServiceProvider to obtain an instance of
TLoadBalancerfrom.timeProviderTimeProviderProvides access to the system time.
Methods
SendAsync(HttpRequestMessage, CancellationToken)
Sends an HTTP request to the inner handler to send to the server as an asynchronous operation.
protected override Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
Parameters
requestHttpRequestMessageThe HTTP request message to send to the server.
cancellationTokenCancellationTokenA cancellation token to cancel operation.
Returns
- Task<HttpResponseMessage>
The task object representing the asynchronous operation.
Exceptions
- ArgumentNullException
The
requestwas null.