Compartilhar via


RetryPolicy Constructor

Definition

Initializes a new instance of the RetryPolicy class.

public RetryPolicy (int maxNumberOfAttempts, TimeSpan firstRetryInterval, double backoffCoefficient = 1, TimeSpan? maxRetryInterval = default, TimeSpan? retryTimeout = default);
new Microsoft.DurableTask.RetryPolicy : int * TimeSpan * double * Nullable<TimeSpan> * Nullable<TimeSpan> -> Microsoft.DurableTask.RetryPolicy
Public Sub New (maxNumberOfAttempts As Integer, firstRetryInterval As TimeSpan, Optional backoffCoefficient As Double = 1, Optional maxRetryInterval As Nullable(Of TimeSpan) = Nothing, Optional retryTimeout As Nullable(Of TimeSpan) = Nothing)

Parameters

maxNumberOfAttempts
Int32

The maximum number of task invocation attempts. Must be 1 or greater.

firstRetryInterval
TimeSpan

The amount of time to delay between the first and second attempt.

backoffCoefficient
Double

The exponential back-off coefficient used to determine the delay between subsequent retries. Must be 1.0 or greater.

maxRetryInterval
Nullable<TimeSpan>

The maximum time to delay between attempts, regardless ofbackoffCoefficient.

retryTimeout
Nullable<TimeSpan>

The overall timeout for retries.

Exceptions

Thrown if any of the following are true:

Remarks

The value InfiniteTimeSpan can be used to specify an unlimited timeout for maxRetryInterval or retryTimeout.

Applies to