Class RetryStrategy
Represents a retry strategy that determines how many times should be retried and the interval between retries.
Inheritance
Namespace: Umbraco.Core.Persistence.FaultHandling
Assembly: Umbraco.Core.dll
Syntax
public abstract class RetryStrategy
Constructors
View SourceRetryStrategy(String, Boolean)
Initializes a new instance of the RetryStrategy class.
Declaration
protected RetryStrategy(string name, bool firstFastRetry)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name of the retry strategy. |
System.Boolean | firstFastRetry | a value indicating whether or not the very first retry attempt will be made immediately whereas the subsequent retries will remain subject to retry interval. |
Fields
View SourceDefaultClientBackoff
The default amount of time used when calculating a random delta in the exponential delay between retries.
Declaration
public static readonly TimeSpan DefaultClientBackoff
Field Value
Type | Description |
---|---|
System.TimeSpan |
DefaultClientRetryCount
The default number of retry attempts.
Declaration
public static readonly int DefaultClientRetryCount
Field Value
Type | Description |
---|---|
System.Int32 |
DefaultExponential
Returns a default policy that implements a random exponential retry interval configured with DefaultClientRetryCount, DefaultMinBackoff, DefaultMaxBackoff and DefaultClientBackoff parameters. The default retry policy treats all caught exceptions as transient errors.
Declaration
public static readonly RetryStrategy DefaultExponential
Field Value
Type | Description |
---|---|
RetryStrategy |
DefaultFirstFastRetry
The default flag indicating whether or not the very first retry attempt will be made immediately whereas the subsequent retries will remain subject to retry interval.
Declaration
public static readonly bool DefaultFirstFastRetry
Field Value
Type | Description |
---|---|
System.Boolean |
DefaultFixed
Returns a default policy that implements a fixed retry interval configured with DefaultClientRetryCount and DefaultRetryInterval parameters. The default retry policy treats all caught exceptions as transient errors.
Declaration
public static readonly RetryStrategy DefaultFixed
Field Value
Type | Description |
---|---|
RetryStrategy |
DefaultMaxBackoff
The default maximum amount of time used when calculating the exponential delay between retries.
Declaration
public static readonly TimeSpan DefaultMaxBackoff
Field Value
Type | Description |
---|---|
System.TimeSpan |
DefaultMinBackoff
The default minimum amount of time used when calculating the exponential delay between retries.
Declaration
public static readonly TimeSpan DefaultMinBackoff
Field Value
Type | Description |
---|---|
System.TimeSpan |
DefaultProgressive
Returns a default policy that implements a progressive retry interval configured with DefaultClientRetryCount, DefaultRetryInterval and DefaultRetryIncrement parameters. The default retry policy treats all caught exceptions as transient errors.
Declaration
public static readonly RetryStrategy DefaultProgressive
Field Value
Type | Description |
---|---|
RetryStrategy |
DefaultRetryIncrement
The default amount of time defining a time increment between retry attempts in the progressive delay policy.
Declaration
public static readonly TimeSpan DefaultRetryIncrement
Field Value
Type | Description |
---|---|
System.TimeSpan |
DefaultRetryInterval
The default amount of time defining an interval between retries.
Declaration
public static readonly TimeSpan DefaultRetryInterval
Field Value
Type | Description |
---|---|
System.TimeSpan |
NoRetry
Returns a default policy that does no retries, it just invokes action exactly once.
Declaration
public static readonly RetryStrategy NoRetry
Field Value
Type | Description |
---|---|
RetryStrategy |
Properties
View SourceFastFirstRetry
Gets or sets a value indicating whether or not the very first retry attempt will be made immediately whereas the subsequent retries will remain subject to retry interval.
Declaration
public bool FastFirstRetry { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Name
Gets the name of the retry strategy.
Declaration
public string Name { get; }
Property Value
Type | Description |
---|---|
System.String |
Methods
View SourceGetShouldRetry()
Returns the corresponding ShouldRetry delegate.
Declaration
public abstract ShouldRetry GetShouldRetry()
Returns
Type | Description |
---|---|
ShouldRetry | The ShouldRetry delegate. |