Interface IHttpBackoffProvider
- Namespace
- Kampute.HttpClient.Interfaces
- Assembly
- Kampute.HttpClient.dll
Defines a contract for creating retry schedulers tailored to specific retry strategies for HTTP requests.
public interface IHttpBackoffProvider
Remarks
This interface allows for the implementation of various retry strategies tailored to HTTP communications, such as fixed delay, exponential backoff, or adaptive strategies. It primarily focuses on generating schedulers that determine the timing and conditions for retry attempts based on the nature o f HTTP request failures.
Methods
CreateScheduler(HttpRequestErrorContext)
Creates a scheduler responsible for managing retry attempts for HTTP requests, based on a specified retry strategy.
IRetryScheduler CreateScheduler(HttpRequestErrorContext ctx)
Parameters
ctx
HttpRequestErrorContextProvides context containing detailed information about the failed HTTP request, including client, request, and error specifics.
Returns
- IRetryScheduler
An instance of IRetryScheduler that coordinates the retry attempts for the given context according to the defined strategy.
Exceptions
- ArgumentNullException
Thrown if
ctx
is null.