AsyncRetrySyntax
Fluent API for defining a AsyncRetryPolicy.
Builds an AsyncRetryPolicy that will retry once.
Builds an AsyncRetryPolicy that will retry retryCount times.
public static AsyncRetryPolicy RetryAsync(this PolicyBuilder policyBuilder, Action<Exception, int> onRetry)
Builds an AsyncRetryPolicy that will retry once
calling onRetry on retry with the raised exception and retry count.
public static AsyncRetryPolicy RetryAsync(this PolicyBuilder policyBuilder, Func<Exception, int, Task> onRetryAsync)
Builds an AsyncRetryPolicy that will retry once
calling onRetryAsync on retry with the raised exception and retry count.
public static AsyncRetryPolicy RetryAsync(this PolicyBuilder policyBuilder, int retryCount, Action<Exception, int> onRetry)
Builds an AsyncRetryPolicy that will retry retryCount times
calling onRetry on each retry with the raised exception and retry count.
public static AsyncRetryPolicy RetryAsync(this PolicyBuilder policyBuilder, int retryCount, Func<Exception, int, Task> onRetryAsync)
Builds an AsyncRetryPolicy that will retry retryCount times
calling onRetryAsync on each retry with the raised exception and retry count.
public static AsyncRetryPolicy RetryAsync(this PolicyBuilder policyBuilder, Action<Exception, int, Context> onRetry)
Builds an AsyncRetryPolicy that will retry once
calling onRetry on retry with the raised exception, retry count and context data.
public static AsyncRetryPolicy RetryAsync(this PolicyBuilder policyBuilder, Func<Exception, int, Context, Task> onRetryAsync)
Builds an AsyncRetryPolicy that will retry once
calling onRetryAsync on retry with the raised exception, retry count and context data.
public static AsyncRetryPolicy RetryAsync(this PolicyBuilder policyBuilder, int retryCount, Action<Exception, int, Context> onRetry)
Builds an AsyncRetryPolicy that will retry retryCount times
calling onRetry on each retry with the raised exception, retry count and context data.
public static AsyncRetryPolicy RetryAsync(this PolicyBuilder policyBuilder, int retryCount, Func<Exception, int, Context, Task> onRetryAsync)
Builds an AsyncRetryPolicy that will retry retryCount times
calling onRetryAsync on each retry with the raised exception, retry count and context data.
Builds an AsyncRetryPolicy that will retry indefinitely until the action succeeds.
public static AsyncRetryPolicy RetryForeverAsync(this PolicyBuilder policyBuilder, Action<Exception> onRetry)
Builds an AsyncRetryPolicy that will retry indefinitely
calling onRetry on each retry with the raised exception.
public static AsyncRetryPolicy RetryForeverAsync(this PolicyBuilder policyBuilder, Action<Exception, int> onRetry)
Builds an AsyncRetryPolicy that will retry indefinitely
calling onRetry on each retry with the raised exception and retry count.
public static AsyncRetryPolicy RetryForeverAsync(this PolicyBuilder policyBuilder, Func<Exception, Task> onRetryAsync)
Builds an AsyncRetryPolicy that will retry indefinitely
calling onRetryAsync on each retry with the raised exception.
public static AsyncRetryPolicy RetryForeverAsync(this PolicyBuilder policyBuilder, Func<Exception, int, Task> onRetryAsync)
Builds an AsyncRetryPolicy that will retry indefinitely
calling onRetryAsync on each retry with the raised exception and retry count.
public static AsyncRetryPolicy RetryForeverAsync(this PolicyBuilder policyBuilder, Action<Exception, Context> onRetry)
Builds an AsyncRetryPolicy that will retry indefinitely
calling onRetry on each retry with the raised exception and context data.
public static AsyncRetryPolicy RetryForeverAsync(this PolicyBuilder policyBuilder, Action<Exception, int, Context> onRetry)
Builds an AsyncRetryPolicy that will retry indefinitely
calling onRetry on each retry with the raised exception, retry count and context data.
public static AsyncRetryPolicy RetryForeverAsync(this PolicyBuilder policyBuilder, Func<Exception, Context, Task> onRetryAsync)
Builds an AsyncRetryPolicy that will retry indefinitely
calling onRetryAsync on each retry with the raised exception and context data.
public static AsyncRetryPolicy RetryForeverAsync(this PolicyBuilder policyBuilder, Func<Exception, int, Context, Task> onRetryAsync)
Builds an AsyncRetryPolicy that will retry indefinitely
calling onRetryAsync on each retry with the raised exception, retry count and context data.
public static AsyncRetryPolicy WaitAndRetryAsync(this PolicyBuilder policyBuilder, int retryCount, Func<int, TimeSpan> sleepDurationProvider)
Builds an AsyncRetryPolicy that will wait and retry retryCount times.
On each retry, the duration to wait is calculated by calling sleepDurationProvider with
the current retry number (1 for first retry, 2 for second etc).
public static AsyncRetryPolicy WaitAndRetryAsync(this PolicyBuilder policyBuilder, int retryCount, Func<int, TimeSpan> sleepDurationProvider, Action<Exception, TimeSpan> onRetry)
Builds an AsyncRetryPolicy that will wait and retry retryCount times
calling onRetry on each retry with the raised exception and the current sleep duration.
On each retry, the duration to wait is calculated by calling sleepDurationProvider with
the current retry number (1 for first retry, 2 for second etc).
public static AsyncRetryPolicy WaitAndRetryAsync(this PolicyBuilder policyBuilder, int retryCount, Func<int, TimeSpan> sleepDurationProvider, Func<Exception, TimeSpan, Task> onRetryAsync)
Builds an AsyncRetryPolicy that will wait and retry retryCount times
calling onRetryAsync on each retry with the raised exception and the current sleep duration.
On each retry, the duration to wait is calculated by calling sleepDurationProvider with
the current retry number (1 for first retry, 2 for second etc).
public static AsyncRetryPolicy WaitAndRetryAsync(this PolicyBuilder policyBuilder, int retryCount, Func<int, TimeSpan> sleepDurationProvider, Action<Exception, TimeSpan, Context> onRetry)
Builds an AsyncRetryPolicy that will wait and retry retryCount times
calling onRetry on each retry with the raised exception, the current sleep duration and context data.
On each retry, the duration to wait is calculated by calling sleepDurationProvider with
the current retry number (1 for first retry, 2 for second etc).
public static AsyncRetryPolicy WaitAndRetryAsync(this PolicyBuilder policyBuilder, int retryCount, Func<int, TimeSpan> sleepDurationProvider, Func<Exception, TimeSpan, Context, Task> onRetryAsync)
Builds an AsyncRetryPolicy that will wait and retry retryCount times
calling onRetryAsync on each retry with the raised exception, the current sleep duration and context data.
On each retry, the duration to wait is calculated by calling sleepDurationProvider with
the current retry number (1 for first retry, 2 for second etc).
public static AsyncRetryPolicy WaitAndRetryAsync(this PolicyBuilder policyBuilder, int retryCount, Func<int, TimeSpan> sleepDurationProvider, Action<Exception, TimeSpan, int, Context> onRetry)
Builds an AsyncRetryPolicy that will wait and retry retryCount times
calling onRetry on each retry with the raised exception, the current sleep duration, retry count, and context data.
On each retry, the duration to wait is calculated by calling sleepDurationProvider with
the current retry number (1 for first retry, 2 for second etc).
public static AsyncRetryPolicy WaitAndRetryAsync(this PolicyBuilder policyBuilder, int retryCount, Func<int, TimeSpan> sleepDurationProvider, Func<Exception, TimeSpan, int, Context, Task> onRetryAsync)
Builds an AsyncRetryPolicy that will wait and retry retryCount times
calling onRetryAsync on each retry with the raised exception, the current sleep duration, retry count, and context data.
On each retry, the duration to wait is calculated by calling sleepDurationProvider with
the current retry number (1 for first retry, 2 for second etc).
public static AsyncRetryPolicy WaitAndRetryAsync(this PolicyBuilder policyBuilder, int retryCount, Func<int, Context, TimeSpan> sleepDurationProvider, Action<Exception, TimeSpan, Context> onRetry)
Builds an AsyncRetryPolicy that will wait and retry retryCount times
calling onRetry on each retry with the raised exception, the current sleep duration and context data.
On each retry, the duration to wait is calculated by calling sleepDurationProvider with
the current retry number (1 for first retry, 2 for second etc) and execution context.
public static AsyncRetryPolicy WaitAndRetryAsync(this PolicyBuilder policyBuilder, int retryCount, Func<int, Context, TimeSpan> sleepDurationProvider, Func<Exception, TimeSpan, Context, Task> onRetryAsync)
Builds an AsyncRetryPolicy that will wait and retry retryCount times
calling onRetryAsync on each retry with the raised exception, the current sleep duration and context data.
On each retry, the duration to wait is calculated by calling sleepDurationProvider with
the current retry number (1 for first retry, 2 for second etc) and execution context.
public static AsyncRetryPolicy WaitAndRetryAsync(this PolicyBuilder policyBuilder, int retryCount, Func<int, Context, TimeSpan> sleepDurationProvider, Action<Exception, TimeSpan, int, Context> onRetry)
Builds an AsyncRetryPolicy that will wait and retry retryCount times
calling onRetry on each retry with the raised exception, the current sleep duration, retry count, and context data.
On each retry, the duration to wait is calculated by calling sleepDurationProvider with
the current retry number (1 for first retry, 2 for second etc) and execution context.
public static AsyncRetryPolicy WaitAndRetryAsync(this PolicyBuilder policyBuilder, int retryCount, Func<int, Context, TimeSpan> sleepDurationProvider, Func<Exception, TimeSpan, int, Context, Task> onRetryAsync)
Builds an AsyncRetryPolicy that will wait and retry retryCount times
calling onRetryAsync on each retry with the raised exception, the current sleep duration, retry count, and context data.
On each retry, the duration to wait is calculated by calling sleepDurationProvider with
the current retry number (1 for first retry, 2 for second etc) and execution context.
public static AsyncRetryPolicy WaitAndRetryAsync(this PolicyBuilder policyBuilder, int retryCount, Func<int, Exception, Context, TimeSpan> sleepDurationProvider, Func<Exception, TimeSpan, int, Context, Task> onRetryAsync)
Builds an AsyncRetryPolicy that will wait and retry retryCount times
calling onRetryAsync on each retry with the raised exception, the current sleep duration, retry count, and context data.
On each retry, the duration to wait is calculated by calling sleepDurationProvider with
the current retry number (1 for first retry, 2 for second etc), previous exception and execution context.
public static AsyncRetryPolicy WaitAndRetryAsync(this PolicyBuilder policyBuilder, IEnumerable<TimeSpan> sleepDurations)
Builds an AsyncRetryPolicy that will wait and retry as many times as there are provided
sleepDurations
On each retry, the duration to wait is the current sleepDurations item.
public static AsyncRetryPolicy WaitAndRetryAsync(this PolicyBuilder policyBuilder, IEnumerable<TimeSpan> sleepDurations, Action<Exception, TimeSpan> onRetry)
Builds an AsyncRetryPolicy that will wait and retry as many times as there are provided
sleepDurations
calling onRetry on each retry with the raised exception and the current sleep duration.
On each retry, the duration to wait is the current sleepDurations item.
public static AsyncRetryPolicy WaitAndRetryAsync(this PolicyBuilder policyBuilder, IEnumerable<TimeSpan> sleepDurations, Func<Exception, TimeSpan, Task> onRetryAsync)
Builds an AsyncRetryPolicy that will wait and retry as many times as there are provided
sleepDurations
calling onRetryAsync on each retry with the raised exception and the current sleep duration.
On each retry, the duration to wait is the current sleepDurations item.
public static AsyncRetryPolicy WaitAndRetryAsync(this PolicyBuilder policyBuilder, IEnumerable<TimeSpan> sleepDurations, Action<Exception, TimeSpan, Context> onRetry)
Builds an AsyncRetryPolicy that will wait and retry as many times as there are provided
sleepDurations
calling onRetry on each retry with the raised exception, the current sleep duration and context data.
On each retry, the duration to wait is the current sleepDurations item.
public static AsyncRetryPolicy WaitAndRetryAsync(this PolicyBuilder policyBuilder, IEnumerable<TimeSpan> sleepDurations, Func<Exception, TimeSpan, Context, Task> onRetryAsync)
Builds an AsyncRetryPolicy that will wait and retry as many times as there are provided
sleepDurations
calling onRetryAsync on each retry with the raised exception, the current sleep duration and context data.
On each retry, the duration to wait is the current sleepDurations item.
public static AsyncRetryPolicy WaitAndRetryAsync(this PolicyBuilder policyBuilder, IEnumerable<TimeSpan> sleepDurations, Action<Exception, TimeSpan, int, Context> onRetry)
Builds an AsyncRetryPolicy that will wait and retry as many times as there are provided
sleepDurations
calling onRetry on each retry with the raised exception, the current sleep duration, retry count, and context data.
On each retry, the duration to wait is the current sleepDurations item.
public static AsyncRetryPolicy WaitAndRetryAsync(this PolicyBuilder policyBuilder, IEnumerable<TimeSpan> sleepDurations, Func<Exception, TimeSpan, int, Context, Task> onRetryAsync)
Builds an AsyncRetryPolicy that will wait and retry as many times as there are provided
sleepDurations
calling onRetryAsync on each retry with the raised exception, the current sleep duration, retry count, and context data.
On each retry, the duration to wait is the current sleepDurations item.
public static AsyncRetryPolicy WaitAndRetryForeverAsync(this PolicyBuilder policyBuilder, Func<int, TimeSpan> sleepDurationProvider)
Builds an AsyncRetryPolicy that will wait and retry indefinitely until the action succeeds.
On each retry, the duration to wait is calculated by calling sleepDurationProvider with
the current retry number (1 for first retry, 2 for second etc).
public static AsyncRetryPolicy WaitAndRetryForeverAsync(this PolicyBuilder policyBuilder, Func<int, Context, TimeSpan> sleepDurationProvider)
Builds an AsyncRetryPolicy that will wait and retry indefinitely until the action succeeds.
On each retry, the duration to wait is calculated by calling sleepDurationProvider with
the current retry number (1 for first retry, 2 for second etc) and execution context.
public static AsyncRetryPolicy WaitAndRetryForeverAsync(this PolicyBuilder policyBuilder, Func<int, TimeSpan> sleepDurationProvider, Action<Exception, TimeSpan> onRetry)
Builds an AsyncRetryPolicy that will wait and retry indefinitely
calling onRetry on each retry with the raised exception.
On each retry, the duration to wait is calculated by calling sleepDurationProvider with
the current retry number (1 for first retry, 2 for second etc).
public static AsyncRetryPolicy WaitAndRetryForeverAsync(this PolicyBuilder policyBuilder, Func<int, TimeSpan> sleepDurationProvider, Action<Exception, int, TimeSpan> onRetry)
Builds an AsyncRetryPolicy that will wait and retry indefinitely
calling onRetry on each retry with the raised exception and retry count.
On each retry, the duration to wait is calculated by calling sleepDurationProvider with
the current retry number (1 for first retry, 2 for second etc).
public static AsyncRetryPolicy WaitAndRetryForeverAsync(this PolicyBuilder policyBuilder, Func<int, TimeSpan> sleepDurationProvider, Func<Exception, TimeSpan, Task> onRetryAsync)
Builds an AsyncRetryPolicy that will wait and retry indefinitely
calling onRetryAsync on each retry with the raised exception.
On each retry, the duration to wait is calculated by calling sleepDurationProvider with
the current retry number (1 for first retry, 2 for second etc).
public static AsyncRetryPolicy WaitAndRetryForeverAsync(this PolicyBuilder policyBuilder, Func<int, TimeSpan> sleepDurationProvider, Func<Exception, int, TimeSpan, Task> onRetryAsync)
Builds an AsyncRetryPolicy that will wait and retry indefinitely
calling onRetryAsync on each retry with the raised exception and retry count.
On each retry, the duration to wait is calculated by calling sleepDurationProvider with
the current retry number (1 for first retry, 2 for second etc).
public static AsyncRetryPolicy WaitAndRetryForeverAsync(this PolicyBuilder policyBuilder, Func<int, Context, TimeSpan> sleepDurationProvider, Action<Exception, TimeSpan, Context> onRetry)
Builds an AsyncRetryPolicy that will wait and retry indefinitely
calling onRetry on each retry with the raised exception and execution context.
On each retry, the duration to wait is calculated by calling sleepDurationProvider with
the current retry number (1 for first retry, 2 for second etc) and execution context.
public static AsyncRetryPolicy WaitAndRetryForeverAsync(this PolicyBuilder policyBuilder, Func<int, Context, TimeSpan> sleepDurationProvider, Action<Exception, int, TimeSpan, Context> onRetry)
Builds an AsyncRetryPolicy that will wait and retry indefinitely
calling onRetry on each retry with the raised exception, retry count and execution context.
On each retry, the duration to wait is calculated by calling sleepDurationProvider with
the current retry number (1 for first retry, 2 for second etc) and execution context.
public static AsyncRetryPolicy WaitAndRetryForeverAsync(this PolicyBuilder policyBuilder, Func<int, Context, TimeSpan> sleepDurationProvider, Func<Exception, TimeSpan, Context, Task> onRetryAsync)
Builds an AsyncRetryPolicy that will wait and retry indefinitely
calling onRetryAsync on each retry with the raised exception and execution context.
On each retry, the duration to wait is calculated by calling sleepDurationProvider with
the current retry number (1 for first retry, 2 for second etc) and execution context.
public static AsyncRetryPolicy WaitAndRetryForeverAsync(this PolicyBuilder policyBuilder, Func<int, Context, TimeSpan> sleepDurationProvider, Func<Exception, int, TimeSpan, Context, Task> onRetryAsync)
Builds an AsyncRetryPolicy that will wait and retry indefinitely
calling onRetryAsync on each retry with the raised exception, retry count and execution context.
On each retry, the duration to wait is calculated by calling sleepDurationProvider with
the current retry number (1 for first retry, 2 for second etc) and execution context.
public static AsyncRetryPolicy WaitAndRetryForeverAsync(this PolicyBuilder policyBuilder, Func<int, Exception, Context, TimeSpan> sleepDurationProvider, Func<Exception, TimeSpan, Context, Task> onRetryAsync)
Builds an AsyncRetryPolicy that will wait and retry indefinitely
calling onRetryAsync on each retry with the raised exception and execution context.
On each retry, the duration to wait is calculated by calling sleepDurationProvider with
the current retry number (1 for first retry, 2 for second etc), previous exception and execution context.
public static AsyncRetryPolicy WaitAndRetryForeverAsync(this PolicyBuilder policyBuilder, Func<int, Exception, Context, TimeSpan> sleepDurationProvider, Func<Exception, int, TimeSpan, Context, Task> onRetryAsync)
Builds an AsyncRetryPolicy that will wait and retry indefinitely
calling onRetryAsync on each retry with the raised exception, retry count and execution context.
On each retry, the duration to wait is calculated by calling sleepDurationProvider with
the current retry number (1 for first retry, 2 for second etc), previous exception and execution context.