RetrySyntax
Fluent API for defining a Retry Policy.
Builds a Policy that will retry once.
Builds a Policy that will retry retryCount times.
Builds a Policy that will retry once
calling onRetry on retry with the raised exception and retry count.
public static RetryPolicy Retry(this PolicyBuilder policyBuilder, int retryCount, Action<Exception, int> onRetry)
Builds a Policy that will retry retryCount times
calling onRetry on each retry with the raised exception and retry count.
public static RetryPolicy Retry(this PolicyBuilder policyBuilder, Action<Exception, int, Context> onRetry)
Builds a Policy that will retry once
calling onRetry on retry with the raised exception, retry count and context data.
public static RetryPolicy Retry(this PolicyBuilder policyBuilder, int retryCount, Action<Exception, int, Context> onRetry)
Builds a Policy that will retry retryCount times
calling onRetry on each retry with the raised exception, retry count and context data.
Builds a Policy that will retry once.
Builds a Policy that will retry retryCount times.
public static RetryPolicy RetryAsync(this PolicyBuilder policyBuilder, Action<Exception, int> onRetry)
Builds a Policy that will retry once
calling onRetry on retry with the raised exception and retry count.
public static RetryPolicy RetryAsync(this PolicyBuilder policyBuilder, int retryCount, Action<Exception, int> onRetry)
Builds a Policy that will retry retryCount times
calling onRetry on each retry with the raised exception and retry count.
public static RetryPolicy RetryAsync(this PolicyBuilder policyBuilder, Action<Exception, int, Context> onRetry)
Builds a Policy that will retry once
calling onRetry on retry with the raised exception, retry count and context data.
public static RetryPolicy RetryAsync(this PolicyBuilder policyBuilder, int retryCount, Action<Exception, int, Context> onRetry)
Builds a Policy that will retry retryCount times
calling onRetry on each retry with the raised exception, retry count and context data.
Builds a Policy that will retry indefinitely.
Builds a Policy that will retry indefinitely
calling onRetry on each retry with the raised exception.
public static RetryPolicy RetryForever(this PolicyBuilder policyBuilder, Action<Exception, Context> onRetry)
Builds a Policy that will retry indefinitely
calling onRetry on each retry with the raised exception and context data.
Builds a Policy that will retry indefinitely.
public static RetryPolicy RetryForeverAsync(this PolicyBuilder policyBuilder, Action<Exception> onRetry)
Builds a Policy that will retry indefinitely
calling onRetry on each retry with the raised exception.
public static RetryPolicy RetryForeverAsync(this PolicyBuilder policyBuilder, Action<Exception, Context> onRetry)
Builds a Policy that will retry indefinitely
calling onRetry on each retry with the raised exception and context data.
public static RetryPolicy WaitAndRetry(this PolicyBuilder policyBuilder, int retryCount, Func<int, TimeSpan> sleepDurationProvider)
Builds a Policy that will wait and retry retryCount times.
On each retry, the duration to wait is calculated by calling sleepDurationProvider with
the current retry attempt allowing an exponentially increasing wait time (exponential backoff).
public static RetryPolicy WaitAndRetry(this PolicyBuilder policyBuilder, int retryCount, Func<int, TimeSpan> sleepDurationProvider, Action<Exception, TimeSpan> onRetry)
Builds a Policy 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 attempt allowing an exponentially increasing wait time (exponential backoff).
public static RetryPolicy WaitAndRetry(this PolicyBuilder policyBuilder, int retryCount, Func<int, TimeSpan> sleepDurationProvider, Action<Exception, TimeSpan, Context> onRetry)
Builds a Policy that will wait and retry retryCount times
calling onRetry on each retry with the raised exception, current sleep duration and context data.
On each retry, the duration to wait is calculated by calling sleepDurationProvider with
the current retry attempt allowing an exponentially increasing wait time (exponential backoff).
public static RetryPolicy WaitAndRetry(this PolicyBuilder policyBuilder, IEnumerable<TimeSpan> sleepDurations)
Builds a Policy 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 RetryPolicy WaitAndRetry(this PolicyBuilder policyBuilder, IEnumerable<TimeSpan> sleepDurations, Action<Exception, TimeSpan> onRetry)
Builds a Policy 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 RetryPolicy WaitAndRetry(this PolicyBuilder policyBuilder, IEnumerable<TimeSpan> sleepDurations, Action<Exception, TimeSpan, Context> onRetry)
Builds a Policy that will wait and retry as many times as there are provided sleepDurations
calling onRetry on each retry with the raised exception, current sleep duration and context data.
On each retry, the duration to wait is the current sleepDurations item.
public static RetryPolicy WaitAndRetryAsync(this PolicyBuilder policyBuilder, int retryCount, Func<int, TimeSpan> sleepDurationProvider)
Builds a Policy that will wait and retry retryCount times.
On each retry, the duration to wait is calculated by calling sleepDurationProvider with
the current retry attempt allowing an exponentially increasing wait time (exponential backoff).
public static RetryPolicy WaitAndRetryAsync(this PolicyBuilder policyBuilder, int retryCount, Func<int, TimeSpan> sleepDurationProvider, Action<Exception, TimeSpan> onRetry)
Builds a Policy 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 attempt allowing an exponentially increasing wait time (exponential backoff).
public static RetryPolicy WaitAndRetryAsync(this PolicyBuilder policyBuilder, int retryCount, Func<int, TimeSpan> sleepDurationProvider, Action<Exception, TimeSpan, Context> onRetry)
Builds a Policy 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 attempt allowing an exponentially increasing wait time (exponential backoff).
public static RetryPolicy WaitAndRetryAsync(this PolicyBuilder policyBuilder, IEnumerable<TimeSpan> sleepDurations)
Builds a Policy 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 RetryPolicy WaitAndRetryAsync(this PolicyBuilder policyBuilder, IEnumerable<TimeSpan> sleepDurations, Action<Exception, TimeSpan> onRetry)
Builds a Policy 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 RetryPolicy WaitAndRetryAsync(this PolicyBuilder policyBuilder, IEnumerable<TimeSpan> sleepDurations, Action<Exception, TimeSpan, Context> onRetry)
Builds a Policy 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 RetryPolicy WaitAndRetryForever(this PolicyBuilder policyBuilder, Func<int, TimeSpan> sleepDurationProvider)
Builds a Policy that will wait and retry indefinitely.
public static RetryPolicy WaitAndRetryForever(this PolicyBuilder policyBuilder, Func<int, TimeSpan> sleepDurationProvider, Action<Exception, TimeSpan> onRetry)
Builds a Policy that will wait and retry indefinitely
calling onRetry on each retry with the raised exception.
public static RetryPolicy WaitAndRetryForever(this PolicyBuilder policyBuilder, Func<int, TimeSpan> sleepDurationProvider, Action<Exception, TimeSpan, Context> onRetry)
Builds a Policy that will wait and retry indefinitely
calling onRetry on each retry with the raised exception and
execution context.
public static RetryPolicy WaitAndRetryForeverAsync(this PolicyBuilder policyBuilder, Func<int, TimeSpan> sleepDurationProvider)
Builds a Policy that will wait and retry indefinitely.
public static RetryPolicy WaitAndRetryForeverAsync(this PolicyBuilder policyBuilder, Func<int, TimeSpan> sleepDurationProvider, Action<Exception, TimeSpan> onRetry)
Builds a Policy that will wait and retry indefinitely
calling onRetry on each retry with the raised exception.
public static RetryPolicy WaitAndRetryForeverAsync(this PolicyBuilder policyBuilder, Func<int, TimeSpan> sleepDurationProvider, Action<Exception, TimeSpan, Context> onRetry)
Builds a Policy that will wait and retry indefinitely
calling onRetry on each retry with the raised exception and
execution context.