Class DefaultRetryStrategy
Default retry strategy for HTTP request to MercadoPago's API
Implements
Inherited Members
Namespace: MercadoPago.Http
Assembly: MercadoPago.dll
Syntax
public class DefaultRetryStrategy : IRetryStrategy
Constructors
| Edit this page View SourceDefaultRetryStrategy(int)
Initializes a new instance of the DefaultRetryStrategy class.
Declaration
public DefaultRetryStrategy(int maxNumberRetries)
Parameters
Type | Name | Description |
---|---|---|
int | maxNumberRetries | Max number of retries. |
Properties
| Edit this page View SourceMaxDelay
Maximum delay before retrying sending HTTP requests after a failure.
Declaration
public static TimeSpan MaxDelay { get; }
Property Value
Type | Description |
---|---|
TimeSpan |
MaxNumberRetries
Max number of retries.
Declaration
public int MaxNumberRetries { get; }
Property Value
Type | Description |
---|---|
int |
MinDelay
Minimum delay before retrying sending HTTP requests after a failure.
Declaration
public static TimeSpan MinDelay { get; }
Property Value
Type | Description |
---|---|
TimeSpan |
Methods
| Edit this page View SourceShouldRetry(HttpRequestMessage, HttpResponseMessage, bool, int)
Indicates if should retry the HTTP request.
Declaration
public RetryResponse ShouldRetry(HttpRequestMessage httpRequest, HttpResponseMessage httpResponse, bool hadRetryableError, int numberRetries)
Parameters
Type | Name | Description |
---|---|---|
HttpRequestMessage | httpRequest | The HTTP request data sent. |
HttpResponseMessage | httpResponse | The HTTP response data if the HTTP request succeeded. |
bool | hadRetryableError | If the HTTP request had a retryable error. |
int | numberRetries | Number of retries already made. |
Returns
Type | Description |
---|---|
RetryResponse | A RetryResponse indicating if should retry and the time to delay before next retry. |