RetryPolicy
Provides the base implementation of the retry mechanism for unreliable actions and transient conditions.
Returns a default policy that implements a random exponential retry interval configured with the default FixedInterval retry strategy.
The default retry policy treats all caught exceptions as transient errors.
Returns a default policy that implements a fixed retry interval configured with the default FixedInterval retry strategy.
The default retry policy treats all caught exceptions as transient errors.
Returns a default policy that implements a progressive retry interval configured with the default Incremental retry strategy.
The default retry policy treats all caught exceptions as transient errors.
Returns a default policy that performs no retries, but invokes the action only once.
Gets the instance of the error detection strategy.
Gets the retry strategy.
An instance of a callback delegate that will be invoked whenever a retry condition is encountered.
public RetryPolicy(ITransientErrorDetectionStrategy errorDetectionStrategy, RetryStrategy retryStrategy)
Initializes a new instance of the RetryPolicy class with the specified number of retry attempts and parameters defining the progressive delay between retries.
Initializes a new instance of the RetryPolicy class with the specified number of retry attempts and default fixed time interval between retries.
public RetryPolicy(ITransientErrorDetectionStrategy errorDetectionStrategy, int retryCount, TimeSpan retryInterval)
Initializes a new instance of the RetryPolicy class with the specified number of retry attempts and fixed time interval between retries.
public RetryPolicy(ITransientErrorDetectionStrategy errorDetectionStrategy, int retryCount, TimeSpan minBackoff, TimeSpan maxBackoff, TimeSpan deltaBackoff)
Initializes a new instance of the RetryPolicy class with the specified number of retry attempts and backoff parameters for calculating the exponential delay between retries.
public RetryPolicy(ITransientErrorDetectionStrategy errorDetectionStrategy, int retryCount, TimeSpan initialInterval, TimeSpan increment)
Initializes a new instance of the RetryPolicy class with the specified number of retry attempts and parameters defining the progressive delay between retries.
Repetitively executes the specified action while it satisfies the current retry policy.
Repetitively executes the specified action while it satisfies the current retry policy.
Repetitively executes the specified asynchronous task while it satisfies the current retry policy.
Repetitively executes the specified asynchronous task while it satisfies the current retry policy.
Repeatedly executes the specified asynchronous task while it satisfies the current retry policy.
public Task<TResult> ExecuteAsync<TResult>(Func<Task<TResult>> taskFunc, CancellationToken cancellationToken)
Repeatedly executes the specified asynchronous task while it satisfies the current retry policy.
Notifies the subscribers whenever a retry condition is encountered.