Class BackoffStrategy
- Namespace
- Kampute.HttpClient.RetryManagement
- Assembly
- Kampute.HttpClient.dll
A factory for creating RetryScheduler instances configured with a specific retry strategy.
public class BackoffStrategy : IHttpBackoffProvider
- Inheritance
-
BackoffStrategy
- Implements
- Inherited Members
Remarks
This factory encapsulates the creation logic of retry schedulers, allowing for consistent configuration of schedulers across an application. It uses a designated retry strategy to configure each scheduler it creates, ensuring that all schedulers have a uniform approach to handling retry attempts.
Constructors
BackoffStrategy(IRetryStrategy)
Initializes a new instance of the BackoffStrategy class with a specified retry strategy.
public BackoffStrategy(IRetryStrategy strategy)
Parameters
strategy
IRetryStrategyThe retry strategy to be used by schedulers created by this factory.
Exceptions
- ArgumentNullException
Thrown if
strategy
is null.
Properties
Strategy
Gets the retry strategy associated with this scheduler factory.
public virtual IRetryStrategy Strategy { get; }
Property Value
Methods
CreateScheduler()
Creates a RetryScheduler instance using the associated retry strategy.
public virtual IRetryScheduler CreateScheduler()
Returns
- IRetryScheduler
A new instance of RetryScheduler configured with the factory's retry strategy.