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
TLoadBalancer
The 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
serviceProvider
IServiceProviderThe IServiceProvider to obtain an instance of
TLoadBalancer
from.timeProvider
TimeProviderProvides 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
request
HttpRequestMessageThe HTTP request message to send to the server.
cancellationToken
CancellationTokenA cancellation token to cancel operation.
Returns
- Task<HttpResponseMessage>
The task object representing the asynchronous operation.
Exceptions
- ArgumentNullException
The
request
was null.