C# Class Polly.RetrySyntax

Fluent API for defining a Retry Policy.
显示文件 Open project: App-vNext/Polly

Public Methods

Method Description
Retry ( this policyBuilder ) : RetryPolicy

Builds a Policy that will retry once.

Retry ( this policyBuilder, Action onRetry ) : RetryPolicy

Builds a Policy that will retry once calling onRetry on retry with the raised exception, retry count and context data.

Retry ( this policyBuilder, int>.Action onRetry ) : RetryPolicy

Builds a Policy that will retry once calling onRetry on retry with the raised exception and retry count.

Retry ( this policyBuilder, int retryCount ) : RetryPolicy

Builds a Policy that will retry retryCount times.

Retry ( this policyBuilder, int retryCount, Action onRetry ) : RetryPolicy

Builds a Policy that will retry retryCount times calling onRetry on each retry with the raised exception, retry count and context data.

Retry ( this policyBuilder, int retryCount, int>.Action onRetry ) : RetryPolicy

Builds a Policy that will retry retryCount times calling onRetry on each retry with the raised exception and retry count.

RetryForever ( this policyBuilder ) : RetryPolicy

Builds a Policy that will retry indefinitely.

RetryForever ( this policyBuilder, Context>.Action onRetry ) : RetryPolicy

Builds a Policy that will retry indefinitely calling onRetry on each retry with the raised exception and context data.

RetryForever ( this policyBuilder, Action onRetry ) : RetryPolicy

Builds a Policy that will retry indefinitely calling onRetry on each retry with the raised exception.

WaitAndRetry ( this policyBuilder, IEnumerable sleepDurations ) : RetryPolicy

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.

WaitAndRetry ( this policyBuilder, IEnumerable sleepDurations, Action onRetry ) : RetryPolicy

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.

WaitAndRetry ( this policyBuilder, IEnumerable sleepDurations, Action onRetry ) : RetryPolicy

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, retry count and context data. On each retry, the duration to wait is the current sleepDurations item.

WaitAndRetry ( this policyBuilder, IEnumerable sleepDurations, TimeSpan>.Action onRetry ) : RetryPolicy

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.

WaitAndRetry ( this policyBuilder, int retryCount, TimeSpan>.Func sleepDurationProvider ) : RetryPolicy

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).

WaitAndRetry ( this policyBuilder, int retryCount, TimeSpan>.Func sleepDurationProvider, Action onRetry ) : RetryPolicy

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).

WaitAndRetry ( this policyBuilder, int retryCount, TimeSpan>.Func sleepDurationProvider, Action onRetry ) : RetryPolicy

Builds a Policy that will wait and retry retryCount times calling onRetry on each retry with the raised exception, current sleep duration, retry count, 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).

WaitAndRetry ( this policyBuilder, int retryCount, TimeSpan>.Func sleepDurationProvider, TimeSpan>.Action onRetry ) : RetryPolicy

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).

WaitAndRetryForever ( this policyBuilder, TimeSpan>.Func sleepDurationProvider ) : RetryPolicy

Builds a Policy that will wait and retry indefinitely.

WaitAndRetryForever ( this policyBuilder, TimeSpan>.Func sleepDurationProvider, Action onRetry ) : RetryPolicy

Builds a Policy that will wait and retry indefinitely calling onRetry on each retry with the raised exception and execution context.

WaitAndRetryForever ( this policyBuilder, TimeSpan>.Func sleepDurationProvider, TimeSpan>.Action onRetry ) : RetryPolicy

Builds a Policy that will wait and retry indefinitely calling onRetry on each retry with the raised exception.

Method Details

Retry() public static method

Builds a Policy that will retry once.
public static Retry ( this policyBuilder ) : RetryPolicy
policyBuilder this The policy builder.
return Polly.Retry.RetryPolicy

Retry() public static method

Builds a Policy that will retry once calling onRetry on retry with the raised exception, retry count and context data.
onRetry
public static Retry ( this policyBuilder, Action onRetry ) : RetryPolicy
policyBuilder this The policy builder.
onRetry Action The action to call on each retry.
return Polly.Retry.RetryPolicy

Retry() public static method

Builds a Policy that will retry once calling onRetry on retry with the raised exception and retry count.
onRetry
public static Retry ( this policyBuilder, int>.Action onRetry ) : RetryPolicy
policyBuilder this The policy builder.
onRetry int>.Action The action to call on each retry.
return Polly.Retry.RetryPolicy

Retry() public static method

Builds a Policy that will retry retryCount times.
public static Retry ( this policyBuilder, int retryCount ) : RetryPolicy
policyBuilder this The policy builder.
retryCount int The retry count.
return Polly.Retry.RetryPolicy

Retry() public static method

Builds a Policy that will retry retryCount times calling onRetry on each retry with the raised exception, retry count and context data.
retryCount;Value must be greater than or equal to zero. onRetry
public static Retry ( this policyBuilder, int retryCount, Action onRetry ) : RetryPolicy
policyBuilder this The policy builder.
retryCount int The retry count.
onRetry Action The action to call on each retry.
return Polly.Retry.RetryPolicy

Retry() public static method

Builds a Policy that will retry retryCount times calling onRetry on each retry with the raised exception and retry count.
retryCount;Value must be greater than or equal to zero. onRetry
public static Retry ( this policyBuilder, int retryCount, int>.Action onRetry ) : RetryPolicy
policyBuilder this The policy builder.
retryCount int The retry count.
onRetry int>.Action The action to call on each retry.
return Polly.Retry.RetryPolicy

RetryForever() public static method

Builds a Policy that will retry indefinitely.
public static RetryForever ( this policyBuilder ) : RetryPolicy
policyBuilder this The policy builder.
return Polly.Retry.RetryPolicy

RetryForever() public static method

Builds a Policy that will retry indefinitely calling onRetry on each retry with the raised exception and context data.
onRetry
public static RetryForever ( this policyBuilder, Context>.Action onRetry ) : RetryPolicy
policyBuilder this The policy builder.
onRetry Context>.Action The action to call on each retry.
return Polly.Retry.RetryPolicy

RetryForever() public static method

Builds a Policy that will retry indefinitely calling onRetry on each retry with the raised exception.
onRetry
public static RetryForever ( this policyBuilder, Action onRetry ) : RetryPolicy
policyBuilder this The policy builder.
onRetry Action The action to call on each retry.
return Polly.Retry.RetryPolicy

WaitAndRetry() public static method

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 WaitAndRetry ( this policyBuilder, IEnumerable sleepDurations ) : RetryPolicy
policyBuilder this The policy builder.
sleepDurations IEnumerable The sleep durations to wait for on each retry.
return Polly.Retry.RetryPolicy

WaitAndRetry() public static method

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.
/// sleepDurations /// or /// onRetry ///
public static WaitAndRetry ( this policyBuilder, IEnumerable sleepDurations, Action onRetry ) : RetryPolicy
policyBuilder this The policy builder.
sleepDurations IEnumerable The sleep durations to wait for on each retry.
onRetry Action The action to call on each retry.
return Polly.Retry.RetryPolicy

WaitAndRetry() public static method

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, retry count and context data. On each retry, the duration to wait is the current sleepDurations item.
/// sleepDurations /// or /// onRetry ///
public static WaitAndRetry ( this policyBuilder, IEnumerable sleepDurations, Action onRetry ) : RetryPolicy
policyBuilder this The policy builder.
sleepDurations IEnumerable The sleep durations to wait for on each retry.
onRetry Action The action to call on each retry.
return Polly.Retry.RetryPolicy

WaitAndRetry() public static method

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.
/// sleepDurations /// or /// onRetry ///
public static WaitAndRetry ( this policyBuilder, IEnumerable sleepDurations, TimeSpan>.Action onRetry ) : RetryPolicy
policyBuilder this The policy builder.
sleepDurations IEnumerable The sleep durations to wait for on each retry.
onRetry TimeSpan>.Action The action to call on each retry.
return Polly.Retry.RetryPolicy

WaitAndRetry() public static method

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 WaitAndRetry ( this policyBuilder, int retryCount, TimeSpan>.Func sleepDurationProvider ) : RetryPolicy
policyBuilder this The policy builder.
retryCount int The retry count.
sleepDurationProvider TimeSpan>.Func The function that provides the duration to wait for for a particular retry attempt.
return Polly.Retry.RetryPolicy

WaitAndRetry() public static method

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).
retryCount;Value must be greater than or equal to zero. /// sleepDurationProvider /// or /// onRetry ///
public static WaitAndRetry ( this policyBuilder, int retryCount, TimeSpan>.Func sleepDurationProvider, Action onRetry ) : RetryPolicy
policyBuilder this The policy builder.
retryCount int The retry count.
sleepDurationProvider TimeSpan>.Func The function that provides the duration to wait for for a particular retry attempt.
onRetry Action The action to call on each retry.
return Polly.Retry.RetryPolicy

WaitAndRetry() public static method

Builds a Policy that will wait and retry retryCount times calling onRetry on each retry with the raised exception, current sleep duration, retry count, 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).
retryCount;Value must be greater than or equal to zero. /// timeSpanProvider /// or /// onRetry ///
public static WaitAndRetry ( this policyBuilder, int retryCount, TimeSpan>.Func sleepDurationProvider, Action onRetry ) : RetryPolicy
policyBuilder this The policy builder.
retryCount int The retry count.
sleepDurationProvider TimeSpan>.Func The function that provides the duration to wait for for a particular retry attempt.
onRetry Action The action to call on each retry.
return Polly.Retry.RetryPolicy

WaitAndRetry() public static method

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).
retryCount;Value must be greater than or equal to zero. /// sleepDurationProvider /// or /// onRetry ///
public static WaitAndRetry ( this policyBuilder, int retryCount, TimeSpan>.Func sleepDurationProvider, TimeSpan>.Action onRetry ) : RetryPolicy
policyBuilder this The policy builder.
retryCount int The retry count.
sleepDurationProvider TimeSpan>.Func The function that provides the duration to wait for for a particular retry attempt.
onRetry TimeSpan>.Action The action to call on each retry.
return Polly.Retry.RetryPolicy

WaitAndRetryForever() public static method

Builds a Policy that will wait and retry indefinitely.
sleepDurationProvider
public static WaitAndRetryForever ( this policyBuilder, TimeSpan>.Func sleepDurationProvider ) : RetryPolicy
policyBuilder this The policy builder.
sleepDurationProvider TimeSpan>.Func The function that provides the duration to wait for for a particular retry attempt.
return Polly.Retry.RetryPolicy

WaitAndRetryForever() public static method

Builds a Policy that will wait and retry indefinitely calling onRetry on each retry with the raised exception and execution context.
sleepDurationProvider onRetry
public static WaitAndRetryForever ( this policyBuilder, TimeSpan>.Func sleepDurationProvider, Action onRetry ) : RetryPolicy
policyBuilder this The policy builder.
sleepDurationProvider TimeSpan>.Func
onRetry Action The action to call on each retry.
return Polly.Retry.RetryPolicy

WaitAndRetryForever() public static method

Builds a Policy that will wait and retry indefinitely calling onRetry on each retry with the raised exception.
sleepDurationProvider onRetry
public static WaitAndRetryForever ( this policyBuilder, TimeSpan>.Func sleepDurationProvider, TimeSpan>.Action onRetry ) : RetryPolicy
policyBuilder this The policy builder.
sleepDurationProvider TimeSpan>.Func
onRetry TimeSpan>.Action The action to call on each retry.
return Polly.Retry.RetryPolicy