Class ExponentialRetryHandler
ExponentialRetryHandler is an IRetryHandler implementation, with an exponentially growing interval between retries
Implements
Inherited Members
Namespace: QarnotSDK
Assembly: QarnotSDK.dll
Syntax
public class ExponentialRetryHandler : IRetryHandler, IDisposable
Constructors
ExponentialRetryHandler(int, int)
ExponentialRetryHandler constructor
Declaration
public ExponentialRetryHandler(int maxRetries = 3, int interval = 500)
Parameters
Type | Name | Description |
---|---|---|
int | maxRetries | maximum number of retry |
int | interval | interval between retries in milliseconds |
Methods
SendAsync(HttpRequestMessage, CancellationToken)
Handle asynchrone request with the retry policy
Declaration
protected override Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
HttpRequestMessage | request | the Http request |
CancellationToken | cancellationToken | cancellationg token to cancel the async request |
Returns
Type | Description |
---|---|
Task<HttpResponseMessage> | the HttpResponseMessage |