src/Orleans.Core/Async/AsyncExecutorWithRetries.cs
/// <summary>
/// Execute a given function a number of times, based on retry configuration parameters.
/// </summary>
/// <param name="action">
/// The action to be executed.
/// </param>
/// <param name="maxNumErrorTries">
/// The maximum number of retries.
/// </param>
/// <param name="retryExceptionFilter">
/// The retry exception filter.
/// </param>
/// <param name="maxExecutionTime">
/// The maximum execution time.
/// </param>
/// <param name="onErrorBackOff">
/// The backoff provider.
/// </param>
/// <returns>
/// A <see cref="Task"/> representing the operation.
/// </returns>
Execute a given function a number of times, based on retry configuration parameters.
Execute a given function a number of times based on retry configuration parameters .
public static Task ExecuteWithRetries(
            Func<int, Task> action,
            int maxNumErrorTries,
            Func<Exception, int, bool> retryExceptionFilter,
            TimeSpan maxExecutionTime,
            IBackoffProvider onErrorBackOff)
        {
            Func<int, Task<bool>> function = async (int i) => { await action(i); return true; };
            return ExecuteWithRetriesHelper<bool>(
                function,
                0,
                maxNumErrorTries,
                maxExecutionTime,
                DateTime.UtcNow,
                null,
                retryExceptionFilter,
                null,
                onErrorBackOff);
        }
public static Task ExecuteWithRetries ( Func < int , Task > action , int maxNumErrorTries , Func < Exception , int , bool > retryExceptionFilter , TimeSpan maxExecutionTime , IBackoffProvider onErrorBackOff ) { Func < int , Task < bool > > function = async ( int i ) => { await action ( i ) ; return true ; } ; return ExecuteWithRetriesHelper < bool > ( function , 0 , maxNumErrorTries , maxExecutionTime , DateTime . UtcNow , null , retryExceptionFilter , null , onErrorBackOff ) ; }
Execute a given function a number of times, based on retry configuration parameters.
Execute a given function a number of times based on retry configuration parameters .
A  representing the operation.
A representing the operation .
action
Func<int, Task>
The action to be executed.
The action to be executed .
maxNumErrorTries
int
The maximum number of retries.
The maximum number of retries .
retryExceptionFilter
Func<Exception, int, bool>
The retry exception filter.
The retry exception filter .
maxExecutionTime
TimeSpan
The maximum execution time.
The maximum execution time .
onErrorBackOff
IBackoffProvider
The backoff provider.
The backoff provider .