Table of Contents

Class AsyncRetrySyntax

Namespace
Polly
Assembly
Polly.dll
public static class AsyncRetrySyntax
Inheritance
AsyncRetrySyntax
Inherited Members

Methods

RetryAsync(PolicyBuilder)

public static AsyncRetryPolicy RetryAsync(this PolicyBuilder policyBuilder)

Parameters

policyBuilder PolicyBuilder

Returns

AsyncRetryPolicy

RetryAsync(PolicyBuilder, Action<Exception, int, Context>)

public static AsyncRetryPolicy RetryAsync(this PolicyBuilder policyBuilder, Action<Exception, int, Context> onRetry)

Parameters

policyBuilder PolicyBuilder
onRetry Action<Exception, int, Context>

Returns

AsyncRetryPolicy

RetryAsync(PolicyBuilder, Action<Exception, int>)

public static AsyncRetryPolicy RetryAsync(this PolicyBuilder policyBuilder, Action<Exception, int> onRetry)

Parameters

policyBuilder PolicyBuilder
onRetry Action<Exception, int>

Returns

AsyncRetryPolicy

RetryAsync(PolicyBuilder, Func<Exception, int, Context, Task>)

public static AsyncRetryPolicy RetryAsync(this PolicyBuilder policyBuilder, Func<Exception, int, Context, Task> onRetryAsync)

Parameters

policyBuilder PolicyBuilder
onRetryAsync Func<Exception, int, Context, Task>

Returns

AsyncRetryPolicy

RetryAsync(PolicyBuilder, Func<Exception, int, Task>)

public static AsyncRetryPolicy RetryAsync(this PolicyBuilder policyBuilder, Func<Exception, int, Task> onRetryAsync)

Parameters

policyBuilder PolicyBuilder
onRetryAsync Func<Exception, int, Task>

Returns

AsyncRetryPolicy

RetryAsync(PolicyBuilder, int)

public static AsyncRetryPolicy RetryAsync(this PolicyBuilder policyBuilder, int retryCount)

Parameters

policyBuilder PolicyBuilder
retryCount int

Returns

AsyncRetryPolicy

RetryAsync(PolicyBuilder, int, Action<Exception, int, Context>)

public static AsyncRetryPolicy RetryAsync(this PolicyBuilder policyBuilder, int retryCount, Action<Exception, int, Context> onRetry)

Parameters

policyBuilder PolicyBuilder
retryCount int
onRetry Action<Exception, int, Context>

Returns

AsyncRetryPolicy

RetryAsync(PolicyBuilder, int, Action<Exception, int>)

public static AsyncRetryPolicy RetryAsync(this PolicyBuilder policyBuilder, int retryCount, Action<Exception, int> onRetry)

Parameters

policyBuilder PolicyBuilder
retryCount int
onRetry Action<Exception, int>

Returns

AsyncRetryPolicy

RetryAsync(PolicyBuilder, int, Func<Exception, int, Context, Task>)

public static AsyncRetryPolicy RetryAsync(this PolicyBuilder policyBuilder, int retryCount, Func<Exception, int, Context, Task> onRetryAsync)

Parameters

policyBuilder PolicyBuilder
retryCount int
onRetryAsync Func<Exception, int, Context, Task>

Returns

AsyncRetryPolicy

RetryAsync(PolicyBuilder, int, Func<Exception, int, Task>)

public static AsyncRetryPolicy RetryAsync(this PolicyBuilder policyBuilder, int retryCount, Func<Exception, int, Task> onRetryAsync)

Parameters

policyBuilder PolicyBuilder
retryCount int
onRetryAsync Func<Exception, int, Task>

Returns

AsyncRetryPolicy

RetryForeverAsync(PolicyBuilder)

public static AsyncRetryPolicy RetryForeverAsync(this PolicyBuilder policyBuilder)

Parameters

policyBuilder PolicyBuilder

Returns

AsyncRetryPolicy

RetryForeverAsync(PolicyBuilder, Action<Exception, Context>)

public static AsyncRetryPolicy RetryForeverAsync(this PolicyBuilder policyBuilder, Action<Exception, Context> onRetry)

Parameters

policyBuilder PolicyBuilder
onRetry Action<Exception, Context>

Returns

AsyncRetryPolicy

RetryForeverAsync(PolicyBuilder, Action<Exception, int, Context>)

public static AsyncRetryPolicy RetryForeverAsync(this PolicyBuilder policyBuilder, Action<Exception, int, Context> onRetry)

Parameters

policyBuilder PolicyBuilder
onRetry Action<Exception, int, Context>

Returns

AsyncRetryPolicy

RetryForeverAsync(PolicyBuilder, Action<Exception, int>)

public static AsyncRetryPolicy RetryForeverAsync(this PolicyBuilder policyBuilder, Action<Exception, int> onRetry)

Parameters

policyBuilder PolicyBuilder
onRetry Action<Exception, int>

Returns

AsyncRetryPolicy

RetryForeverAsync(PolicyBuilder, Action<Exception>)

public static AsyncRetryPolicy RetryForeverAsync(this PolicyBuilder policyBuilder, Action<Exception> onRetry)

Parameters

policyBuilder PolicyBuilder
onRetry Action<Exception>

Returns

AsyncRetryPolicy

RetryForeverAsync(PolicyBuilder, Func<Exception, Context, Task>)

public static AsyncRetryPolicy RetryForeverAsync(this PolicyBuilder policyBuilder, Func<Exception, Context, Task> onRetryAsync)

Parameters

policyBuilder PolicyBuilder
onRetryAsync Func<Exception, Context, Task>

Returns

AsyncRetryPolicy

RetryForeverAsync(PolicyBuilder, Func<Exception, int, Context, Task>)

public static AsyncRetryPolicy RetryForeverAsync(this PolicyBuilder policyBuilder, Func<Exception, int, Context, Task> onRetryAsync)

Parameters

policyBuilder PolicyBuilder
onRetryAsync Func<Exception, int, Context, Task>

Returns

AsyncRetryPolicy

RetryForeverAsync(PolicyBuilder, Func<Exception, int, Task>)

public static AsyncRetryPolicy RetryForeverAsync(this PolicyBuilder policyBuilder, Func<Exception, int, Task> onRetryAsync)

Parameters

policyBuilder PolicyBuilder
onRetryAsync Func<Exception, int, Task>

Returns

AsyncRetryPolicy

RetryForeverAsync(PolicyBuilder, Func<Exception, Task>)

public static AsyncRetryPolicy RetryForeverAsync(this PolicyBuilder policyBuilder, Func<Exception, Task> onRetryAsync)

Parameters

policyBuilder PolicyBuilder
onRetryAsync Func<Exception, Task>

Returns

AsyncRetryPolicy

WaitAndRetryAsync(PolicyBuilder, IEnumerable<TimeSpan>)

public static AsyncRetryPolicy WaitAndRetryAsync(this PolicyBuilder policyBuilder, IEnumerable<TimeSpan> sleepDurations)

Parameters

policyBuilder PolicyBuilder
sleepDurations IEnumerable<TimeSpan>

Returns

AsyncRetryPolicy

WaitAndRetryAsync(PolicyBuilder, IEnumerable<TimeSpan>, Action<Exception, TimeSpan, Context>)

public static AsyncRetryPolicy WaitAndRetryAsync(this PolicyBuilder policyBuilder, IEnumerable<TimeSpan> sleepDurations, Action<Exception, TimeSpan, Context> onRetry)

Parameters

policyBuilder PolicyBuilder
sleepDurations IEnumerable<TimeSpan>
onRetry Action<Exception, TimeSpan, Context>

Returns

AsyncRetryPolicy

WaitAndRetryAsync(PolicyBuilder, IEnumerable<TimeSpan>, Action<Exception, TimeSpan, int, Context>)

public static AsyncRetryPolicy WaitAndRetryAsync(this PolicyBuilder policyBuilder, IEnumerable<TimeSpan> sleepDurations, Action<Exception, TimeSpan, int, Context> onRetry)

Parameters

policyBuilder PolicyBuilder
sleepDurations IEnumerable<TimeSpan>
onRetry Action<Exception, TimeSpan, int, Context>

Returns

AsyncRetryPolicy

WaitAndRetryAsync(PolicyBuilder, IEnumerable<TimeSpan>, Action<Exception, TimeSpan>)

public static AsyncRetryPolicy WaitAndRetryAsync(this PolicyBuilder policyBuilder, IEnumerable<TimeSpan> sleepDurations, Action<Exception, TimeSpan> onRetry)

Parameters

policyBuilder PolicyBuilder
sleepDurations IEnumerable<TimeSpan>
onRetry Action<Exception, TimeSpan>

Returns

AsyncRetryPolicy

WaitAndRetryAsync(PolicyBuilder, IEnumerable<TimeSpan>, Func<Exception, TimeSpan, Context, Task>)

public static AsyncRetryPolicy WaitAndRetryAsync(this PolicyBuilder policyBuilder, IEnumerable<TimeSpan> sleepDurations, Func<Exception, TimeSpan, Context, Task> onRetryAsync)

Parameters

policyBuilder PolicyBuilder
sleepDurations IEnumerable<TimeSpan>
onRetryAsync Func<Exception, TimeSpan, Context, Task>

Returns

AsyncRetryPolicy

WaitAndRetryAsync(PolicyBuilder, IEnumerable<TimeSpan>, Func<Exception, TimeSpan, int, Context, Task>)

public static AsyncRetryPolicy WaitAndRetryAsync(this PolicyBuilder policyBuilder, IEnumerable<TimeSpan> sleepDurations, Func<Exception, TimeSpan, int, Context, Task> onRetryAsync)

Parameters

policyBuilder PolicyBuilder
sleepDurations IEnumerable<TimeSpan>
onRetryAsync Func<Exception, TimeSpan, int, Context, Task>

Returns

AsyncRetryPolicy

WaitAndRetryAsync(PolicyBuilder, IEnumerable<TimeSpan>, Func<Exception, TimeSpan, Task>)

public static AsyncRetryPolicy WaitAndRetryAsync(this PolicyBuilder policyBuilder, IEnumerable<TimeSpan> sleepDurations, Func<Exception, TimeSpan, Task> onRetryAsync)

Parameters

policyBuilder PolicyBuilder
sleepDurations IEnumerable<TimeSpan>
onRetryAsync Func<Exception, TimeSpan, Task>

Returns

AsyncRetryPolicy

WaitAndRetryAsync(PolicyBuilder, int, Func<int, Context, TimeSpan>, Action<Exception, TimeSpan, Context>)

public static AsyncRetryPolicy WaitAndRetryAsync(this PolicyBuilder policyBuilder, int retryCount, Func<int, Context, TimeSpan> sleepDurationProvider, Action<Exception, TimeSpan, Context> onRetry)

Parameters

policyBuilder PolicyBuilder
retryCount int
sleepDurationProvider Func<int, Context, TimeSpan>
onRetry Action<Exception, TimeSpan, Context>

Returns

AsyncRetryPolicy

WaitAndRetryAsync(PolicyBuilder, int, Func<int, Context, TimeSpan>, Action<Exception, TimeSpan, int, Context>)

public static AsyncRetryPolicy WaitAndRetryAsync(this PolicyBuilder policyBuilder, int retryCount, Func<int, Context, TimeSpan> sleepDurationProvider, Action<Exception, TimeSpan, int, Context> onRetry)

Parameters

policyBuilder PolicyBuilder
retryCount int
sleepDurationProvider Func<int, Context, TimeSpan>
onRetry Action<Exception, TimeSpan, int, Context>

Returns

AsyncRetryPolicy

WaitAndRetryAsync(PolicyBuilder, int, Func<int, Context, TimeSpan>, Func<Exception, TimeSpan, Context, Task>)

public static AsyncRetryPolicy WaitAndRetryAsync(this PolicyBuilder policyBuilder, int retryCount, Func<int, Context, TimeSpan> sleepDurationProvider, Func<Exception, TimeSpan, Context, Task> onRetryAsync)

Parameters

policyBuilder PolicyBuilder
retryCount int
sleepDurationProvider Func<int, Context, TimeSpan>
onRetryAsync Func<Exception, TimeSpan, Context, Task>

Returns

AsyncRetryPolicy

WaitAndRetryAsync(PolicyBuilder, int, Func<int, Context, TimeSpan>, Func<Exception, TimeSpan, int, Context, Task>)

public static AsyncRetryPolicy WaitAndRetryAsync(this PolicyBuilder policyBuilder, int retryCount, Func<int, Context, TimeSpan> sleepDurationProvider, Func<Exception, TimeSpan, int, Context, Task> onRetryAsync)

Parameters

policyBuilder PolicyBuilder
retryCount int
sleepDurationProvider Func<int, Context, TimeSpan>
onRetryAsync Func<Exception, TimeSpan, int, Context, Task>

Returns

AsyncRetryPolicy

WaitAndRetryAsync(PolicyBuilder, int, Func<int, Exception, Context, TimeSpan>, Func<Exception, TimeSpan, int, Context, Task>)

public static AsyncRetryPolicy WaitAndRetryAsync(this PolicyBuilder policyBuilder, int retryCount, Func<int, Exception, Context, TimeSpan> sleepDurationProvider, Func<Exception, TimeSpan, int, Context, Task> onRetryAsync)

Parameters

policyBuilder PolicyBuilder
retryCount int
sleepDurationProvider Func<int, Exception, Context, TimeSpan>
onRetryAsync Func<Exception, TimeSpan, int, Context, Task>

Returns

AsyncRetryPolicy

WaitAndRetryAsync(PolicyBuilder, int, Func<int, TimeSpan>)

public static AsyncRetryPolicy WaitAndRetryAsync(this PolicyBuilder policyBuilder, int retryCount, Func<int, TimeSpan> sleepDurationProvider)

Parameters

policyBuilder PolicyBuilder
retryCount int
sleepDurationProvider Func<int, TimeSpan>

Returns

AsyncRetryPolicy

WaitAndRetryAsync(PolicyBuilder, int, Func<int, TimeSpan>, Action<Exception, TimeSpan, Context>)

public static AsyncRetryPolicy WaitAndRetryAsync(this PolicyBuilder policyBuilder, int retryCount, Func<int, TimeSpan> sleepDurationProvider, Action<Exception, TimeSpan, Context> onRetry)

Parameters

policyBuilder PolicyBuilder
retryCount int
sleepDurationProvider Func<int, TimeSpan>
onRetry Action<Exception, TimeSpan, Context>

Returns

AsyncRetryPolicy

WaitAndRetryAsync(PolicyBuilder, int, Func<int, TimeSpan>, Action<Exception, TimeSpan, int, Context>)

public static AsyncRetryPolicy WaitAndRetryAsync(this PolicyBuilder policyBuilder, int retryCount, Func<int, TimeSpan> sleepDurationProvider, Action<Exception, TimeSpan, int, Context> onRetry)

Parameters

policyBuilder PolicyBuilder
retryCount int
sleepDurationProvider Func<int, TimeSpan>
onRetry Action<Exception, TimeSpan, int, Context>

Returns

AsyncRetryPolicy

WaitAndRetryAsync(PolicyBuilder, int, Func<int, TimeSpan>, Action<Exception, TimeSpan>)

public static AsyncRetryPolicy WaitAndRetryAsync(this PolicyBuilder policyBuilder, int retryCount, Func<int, TimeSpan> sleepDurationProvider, Action<Exception, TimeSpan> onRetry)

Parameters

policyBuilder PolicyBuilder
retryCount int
sleepDurationProvider Func<int, TimeSpan>
onRetry Action<Exception, TimeSpan>

Returns

AsyncRetryPolicy

WaitAndRetryAsync(PolicyBuilder, int, Func<int, TimeSpan>, Func<Exception, TimeSpan, Context, Task>)

public static AsyncRetryPolicy WaitAndRetryAsync(this PolicyBuilder policyBuilder, int retryCount, Func<int, TimeSpan> sleepDurationProvider, Func<Exception, TimeSpan, Context, Task> onRetryAsync)

Parameters

policyBuilder PolicyBuilder
retryCount int
sleepDurationProvider Func<int, TimeSpan>
onRetryAsync Func<Exception, TimeSpan, Context, Task>

Returns

AsyncRetryPolicy

WaitAndRetryAsync(PolicyBuilder, int, Func<int, TimeSpan>, Func<Exception, TimeSpan, int, Context, Task>)

public static AsyncRetryPolicy WaitAndRetryAsync(this PolicyBuilder policyBuilder, int retryCount, Func<int, TimeSpan> sleepDurationProvider, Func<Exception, TimeSpan, int, Context, Task> onRetryAsync)

Parameters

policyBuilder PolicyBuilder
retryCount int
sleepDurationProvider Func<int, TimeSpan>
onRetryAsync Func<Exception, TimeSpan, int, Context, Task>

Returns

AsyncRetryPolicy

WaitAndRetryAsync(PolicyBuilder, int, Func<int, TimeSpan>, Func<Exception, TimeSpan, Task>)

public static AsyncRetryPolicy WaitAndRetryAsync(this PolicyBuilder policyBuilder, int retryCount, Func<int, TimeSpan> sleepDurationProvider, Func<Exception, TimeSpan, Task> onRetryAsync)

Parameters

policyBuilder PolicyBuilder
retryCount int
sleepDurationProvider Func<int, TimeSpan>
onRetryAsync Func<Exception, TimeSpan, Task>

Returns

AsyncRetryPolicy

WaitAndRetryForeverAsync(PolicyBuilder, Func<int, Context, TimeSpan>)

public static AsyncRetryPolicy WaitAndRetryForeverAsync(this PolicyBuilder policyBuilder, Func<int, Context, TimeSpan> sleepDurationProvider)

Parameters

policyBuilder PolicyBuilder
sleepDurationProvider Func<int, Context, TimeSpan>

Returns

AsyncRetryPolicy

WaitAndRetryForeverAsync(PolicyBuilder, Func<int, Context, TimeSpan>, Action<Exception, int, TimeSpan, Context>)

public static AsyncRetryPolicy WaitAndRetryForeverAsync(this PolicyBuilder policyBuilder, Func<int, Context, TimeSpan> sleepDurationProvider, Action<Exception, int, TimeSpan, Context> onRetry)

Parameters

policyBuilder PolicyBuilder
sleepDurationProvider Func<int, Context, TimeSpan>
onRetry Action<Exception, int, TimeSpan, Context>

Returns

AsyncRetryPolicy

WaitAndRetryForeverAsync(PolicyBuilder, Func<int, Context, TimeSpan>, Action<Exception, TimeSpan, Context>)

public static AsyncRetryPolicy WaitAndRetryForeverAsync(this PolicyBuilder policyBuilder, Func<int, Context, TimeSpan> sleepDurationProvider, Action<Exception, TimeSpan, Context> onRetry)

Parameters

policyBuilder PolicyBuilder
sleepDurationProvider Func<int, Context, TimeSpan>
onRetry Action<Exception, TimeSpan, Context>

Returns

AsyncRetryPolicy

WaitAndRetryForeverAsync(PolicyBuilder, Func<int, Context, TimeSpan>, Func<Exception, int, TimeSpan, Context, Task>)

public static AsyncRetryPolicy WaitAndRetryForeverAsync(this PolicyBuilder policyBuilder, Func<int, Context, TimeSpan> sleepDurationProvider, Func<Exception, int, TimeSpan, Context, Task> onRetryAsync)

Parameters

policyBuilder PolicyBuilder
sleepDurationProvider Func<int, Context, TimeSpan>
onRetryAsync Func<Exception, int, TimeSpan, Context, Task>

Returns

AsyncRetryPolicy

WaitAndRetryForeverAsync(PolicyBuilder, Func<int, Context, TimeSpan>, Func<Exception, TimeSpan, Context, Task>)

public static AsyncRetryPolicy WaitAndRetryForeverAsync(this PolicyBuilder policyBuilder, Func<int, Context, TimeSpan> sleepDurationProvider, Func<Exception, TimeSpan, Context, Task> onRetryAsync)

Parameters

policyBuilder PolicyBuilder
sleepDurationProvider Func<int, Context, TimeSpan>
onRetryAsync Func<Exception, TimeSpan, Context, Task>

Returns

AsyncRetryPolicy

WaitAndRetryForeverAsync(PolicyBuilder, Func<int, Exception, Context, TimeSpan>, Func<Exception, int, TimeSpan, Context, Task>)

public static AsyncRetryPolicy WaitAndRetryForeverAsync(this PolicyBuilder policyBuilder, Func<int, Exception, Context, TimeSpan> sleepDurationProvider, Func<Exception, int, TimeSpan, Context, Task> onRetryAsync)

Parameters

policyBuilder PolicyBuilder
sleepDurationProvider Func<int, Exception, Context, TimeSpan>
onRetryAsync Func<Exception, int, TimeSpan, Context, Task>

Returns

AsyncRetryPolicy

WaitAndRetryForeverAsync(PolicyBuilder, Func<int, Exception, Context, TimeSpan>, Func<Exception, TimeSpan, Context, Task>)

public static AsyncRetryPolicy WaitAndRetryForeverAsync(this PolicyBuilder policyBuilder, Func<int, Exception, Context, TimeSpan> sleepDurationProvider, Func<Exception, TimeSpan, Context, Task> onRetryAsync)

Parameters

policyBuilder PolicyBuilder
sleepDurationProvider Func<int, Exception, Context, TimeSpan>
onRetryAsync Func<Exception, TimeSpan, Context, Task>

Returns

AsyncRetryPolicy

WaitAndRetryForeverAsync(PolicyBuilder, Func<int, TimeSpan>)

public static AsyncRetryPolicy WaitAndRetryForeverAsync(this PolicyBuilder policyBuilder, Func<int, TimeSpan> sleepDurationProvider)

Parameters

policyBuilder PolicyBuilder
sleepDurationProvider Func<int, TimeSpan>

Returns

AsyncRetryPolicy

WaitAndRetryForeverAsync(PolicyBuilder, Func<int, TimeSpan>, Action<Exception, int, TimeSpan>)

public static AsyncRetryPolicy WaitAndRetryForeverAsync(this PolicyBuilder policyBuilder, Func<int, TimeSpan> sleepDurationProvider, Action<Exception, int, TimeSpan> onRetry)

Parameters

policyBuilder PolicyBuilder
sleepDurationProvider Func<int, TimeSpan>
onRetry Action<Exception, int, TimeSpan>

Returns

AsyncRetryPolicy

WaitAndRetryForeverAsync(PolicyBuilder, Func<int, TimeSpan>, Action<Exception, TimeSpan>)

public static AsyncRetryPolicy WaitAndRetryForeverAsync(this PolicyBuilder policyBuilder, Func<int, TimeSpan> sleepDurationProvider, Action<Exception, TimeSpan> onRetry)

Parameters

policyBuilder PolicyBuilder
sleepDurationProvider Func<int, TimeSpan>
onRetry Action<Exception, TimeSpan>

Returns

AsyncRetryPolicy

WaitAndRetryForeverAsync(PolicyBuilder, Func<int, TimeSpan>, Func<Exception, int, TimeSpan, Task>)

public static AsyncRetryPolicy WaitAndRetryForeverAsync(this PolicyBuilder policyBuilder, Func<int, TimeSpan> sleepDurationProvider, Func<Exception, int, TimeSpan, Task> onRetryAsync)

Parameters

policyBuilder PolicyBuilder
sleepDurationProvider Func<int, TimeSpan>
onRetryAsync Func<Exception, int, TimeSpan, Task>

Returns

AsyncRetryPolicy

WaitAndRetryForeverAsync(PolicyBuilder, Func<int, TimeSpan>, Func<Exception, TimeSpan, Task>)

public static AsyncRetryPolicy WaitAndRetryForeverAsync(this PolicyBuilder policyBuilder, Func<int, TimeSpan> sleepDurationProvider, Func<Exception, TimeSpan, Task> onRetryAsync)

Parameters

policyBuilder PolicyBuilder
sleepDurationProvider Func<int, TimeSpan>
onRetryAsync Func<Exception, TimeSpan, Task>

Returns

AsyncRetryPolicy