Table of Contents

Class ResilienceHttpMessageHandler

Namespace
Apizr.Resiliencing
Assembly
Apizr.dll

Base class for resilience handler, i.e. handlers that use resilience strategies to send the requests.

public class ResilienceHttpMessageHandler : DelegatingHandler, IDisposable
Inheritance
ResilienceHttpMessageHandler
Implements
Inherited Members

Constructors

ResilienceHttpMessageHandler(ResiliencePipelineRegistry<string>, IApizrManagerOptionsBase)

public ResilienceHttpMessageHandler(ResiliencePipelineRegistry<string> registry, IApizrManagerOptionsBase apizrOptions)

Parameters

registry ResiliencePipelineRegistry<string>
apizrOptions IApizrManagerOptionsBase

ResilienceHttpMessageHandler(ResiliencePipeline<HttpResponseMessage>, IApizrManagerOptionsBase)

Initializes a new instance of the ResilienceHttpMessageHandler class.

public ResilienceHttpMessageHandler(ResiliencePipeline<HttpResponseMessage> pipeline, IApizrManagerOptionsBase apizrOptions)

Parameters

pipeline ResiliencePipeline<HttpResponseMessage>

The pipeline to use for the message.

apizrOptions IApizrManagerOptionsBase

The Apizr options

Exceptions

ArgumentNullException

If pipeline is null.

ResilienceHttpMessageHandler(Func<HttpRequestMessage, CancellationToken, ResiliencePipeline<HttpResponseMessage>>, IApizrManagerOptionsBase)

Initializes a new instance of the ResilienceHttpMessageHandler class.

public ResilienceHttpMessageHandler(Func<HttpRequestMessage, CancellationToken, ResiliencePipeline<HttpResponseMessage>> pipelineProvider, IApizrManagerOptionsBase apizrOptions)

Parameters

pipelineProvider Func<HttpRequestMessage, CancellationToken, ResiliencePipeline<HttpResponseMessage>>

The pipeline provider that supplies pipelines in response to an http message.

apizrOptions IApizrManagerOptionsBase

The Apizr options

Exceptions

ArgumentNullException

If pipelineProvider is null.

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 HttpRequestMessage

The HTTP request message to send to the server.

cancellationToken CancellationToken

A cancellation token to cancel operation.

Returns

Task<HttpResponseMessage>

The task object representing the asynchronous operation.

Exceptions

ArgumentNullException

If request is null.