Share via


RetryPolicy Members

Include Protected Members
Include Inherited Members

The RetryPolicy type exposes the following members.

Constructors

  Name Description
Public method RetryPolicy(ITransientErrorDetectionStrategy, RetryStrategy)
Initializes a new instance of the RetryPolicy class with the specified number of retry attempts and parameters defining the progressive delay between retries.
Public method RetryPolicy(ITransientErrorDetectionStrategy, Int32)
Initializes a new instance of the RetryPolicy class with the specified number of retry attempts and default fixed time interval between retries.
Public method RetryPolicy(ITransientErrorDetectionStrategy, Int32, TimeSpan)
Initializes a new instance of the RetryPolicy class with the specified number of retry attempts and fixed time interval between retries.
Public method RetryPolicy(ITransientErrorDetectionStrategy, Int32, TimeSpan, TimeSpan)
Initializes a new instance of the RetryPolicy class with the specified number of retry attempts and parameters defining the progressive delay between retries.
Public method RetryPolicy(ITransientErrorDetectionStrategy, Int32, TimeSpan, TimeSpan, TimeSpan)
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.

Methods

  Name Description
Public method Equals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Public method ExecuteAction(Action)
Repetitively executes the specified action while it satisfies the current retry policy.
Public method ExecuteAction<TResult>(Func<TResult>)
Repetitively executes the specified action while it satisfies the current retry policy.
Public method ExecuteAsync(Func<Task>)
Repetitively executes the specified asynchronous task while it satisfies the current retry policy.
Public method ExecuteAsync(Func<Task>, CancellationToken)
Repetitively executes the specified asynchronous task while it satisfies the current retry policy.
Public method ExecuteAsync<TResult>(Func<Task<TResult>>)
Repeatedly executes the specified asynchronous task while it satisfies the current retry policy.
Public method ExecuteAsync<TResult>(Func<Task<TResult>>, CancellationToken)
Repeatedly executes the specified asynchronous task while it satisfies the current retry policy.
Protected method Finalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public method GetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public method GetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected method MemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Protected method OnRetrying
Notifies the subscribers whenever a retry condition is encountered.
Public method ToString
Returns a string that represents the current object.
(Inherited from Object.)

Properties

  Name Description
Public propertyStatic member DefaultExponential
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.
Public propertyStatic member DefaultFixed
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.
Public propertyStatic member DefaultProgressive
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.
Public property ErrorDetectionStrategy
Gets the instance of the error detection strategy.
Public propertyStatic member NoRetry
Returns a default policy that performs no retries, but invokes the action only once.
Public property RetryStrategy
Gets the retry strategy.

Events

  Name Description
Public event Retrying
An instance of a callback delegate that will be invoked whenever a retry condition is encountered.

See Also

RetryPolicy Class

Microsoft.Practices.EnterpriseLibrary.TransientFaultHandling Namespace