PeanutButter
Loading...
Searching...
No Matches
PeanutButter.Utils.MaxAttemptsRetryContext Class Reference

Provides a wrapping context around retried code. More...

Public Member Functions

 MaxAttemptsRetryContext (int maxAttempts, Func< IBackoffStrategy > defaultBackoffStrategy)
 Creates a RetryContext for the specified maxRetries.
void Times (Action toRun, [CallerMemberName] string caller=null)
 Run the code...
void Times (Action toRun, IBackoffStrategy backoffStrategy, [CallerMemberName] string caller=null)
 Run the code...
void Times (Action toRun, Func< Exception, ExceptionHandlingStrategies > exceptionHandler, [CallerMemberName] string caller=null)
 Run the code...
async Task TimesAsync (Func< Task > toRun, [CallerMemberName] string caller=null)
 Run the provided func up to the specified number of times, or until it completes successfully.
async Task TimesAsync (Func< Task > toRun, Func< Exception, Task< ExceptionHandlingStrategies > > exceptionHandler, [CallerMemberName] string caller=null)
 Run the code...
async Task TimesAsync (Func< int, Task > toRun, Func< Exception, Task< ExceptionHandlingStrategies > > exceptionHandler, [CallerMemberName] string caller=null)
 Run the code...
async Task TimesAsync (Func< int, Task > toRun, IBackoffStrategy backoffStrategy, Func< Exception, Task< ExceptionHandlingStrategies > > exceptionHandler, [CallerMemberName] string caller=null)
void Times (Action toRun, IBackoffStrategy backoffStrategy, Func< Exception, ExceptionHandlingStrategies > exceptionHandler, [CallerMemberName] string caller=null)
 Run the code...
void Times (Action< int > toRun, [CallerMemberName] string caller=null)
 Run the code...
void Times (Action< int > toRun, IBackoffStrategy backoffStrategy, [CallerMemberName] string caller=null)
 Run the code...
void Times (Action< int > toRun, Func< Exception, ExceptionHandlingStrategies > exceptionHandler, [CallerMemberName] string caller=null)
 Run the code...
void Times (Action< int > toRun, IBackoffStrategy backoffStrategy, Func< Exception, ExceptionHandlingStrategies > exceptionHandler, [CallerMemberName] string caller=null)
 Run the code...
async Task< T > Times< T > (Func< int, Task< T > > toRun, [CallerMemberName] string caller=null)
 Run the code...
async Task< T > Times< T > (Func< int, Task< T > > toRun, IBackoffStrategy backoffStrategy, [CallerMemberName] string caller=null)
 Run the code...
async Task< T > Times< T > (Func< int, Task< T > > toRun, IBackoffStrategy backoffStrategy, Func< Exception, ExceptionHandlingStrategies > exceptionHandler=null, [CallerMemberName] string caller=null)
 Run the code...
Times< T > (Func< T > toRun, [CallerMemberName] string caller=null)
 Run the code...
Times< T > (Func< T > toRun, IBackoffStrategy backoffStrategy, [CallerMemberName] string caller=null)
 Run the code...
Times< T > (Func< T > toRun, Func< Exception, ExceptionHandlingStrategies > exceptionHandler, [CallerMemberName] string caller=null)
 Run the code...
Times< T > (Func< int, T > toRun, [CallerMemberName] string caller=null)
 Run the code...
Times< T > (Func< int, T > toRun, IBackoffStrategy backoffStrategy, [CallerMemberName] string caller=null)
 Run the code...
Times< T > (Func< int, T > toRun, Func< Exception, ExceptionHandlingStrategies > exceptionHandler=null, [CallerMemberName] string caller=null)
 Run the code...
Times< T > (Func< int, T > toRun, IBackoffStrategy backoffStrategy, Func< Exception, ExceptionHandlingStrategies > exceptionHandler=null, [CallerMemberName] string caller=null)
 Run the code...
async Task Times (Func< int, Task > toRun, [CallerMemberName] string caller=null)
 Run the code...
async Task Times (Func< int, Task > toRun, IBackoffStrategy backoffStrategy, [CallerMemberName] string caller=null)
 Run the code...
async Task Times (Func< int, Task > toRun, Func< Exception, ExceptionHandlingStrategies > exceptionHandler, [CallerMemberName] string caller=null)
 Run the code...
async Task Times (Func< Task > toRun, [CallerMemberName] string caller=null)
 Run the code...
async Task Times (Func< Task > toRun, IBackoffStrategy backoffStrategy, [CallerMemberName] string caller=null)
 Run the code...
async Task Times (Func< Task > toRun, Func< Exception, ExceptionHandlingStrategies > exceptionHandler, [CallerMemberName] string caller=null)
 Run the code...
async Task Times (Func< int, Task > toRun, IBackoffStrategy backoffStrategy, Func< Exception, ExceptionHandlingStrategies > exceptionHandler, [CallerMemberName] string caller=null)
 Run the code...

Properties

int MaxAttempts [get]
 Maximum number of times to try before giving up.

Detailed Description

Provides a wrapping context around retried code.

Constructor & Destructor Documentation

◆ MaxAttemptsRetryContext()

PeanutButter.Utils.MaxAttemptsRetryContext.MaxAttemptsRetryContext ( int maxAttempts,
Func< IBackoffStrategy > defaultBackoffStrategy )

Creates a RetryContext for the specified maxRetries.

Parameters
maxAttempts
defaultBackoffStrategy

Member Function Documentation

◆ Times() [1/15]

void PeanutButter.Utils.MaxAttemptsRetryContext.Times ( Action toRun,
[CallerMemberName] string caller = null )

Run the code...

Parameters
toRun
caller

◆ Times() [2/15]

void PeanutButter.Utils.MaxAttemptsRetryContext.Times ( Action toRun,
Func< Exception, ExceptionHandlingStrategies > exceptionHandler,
[CallerMemberName] string caller = null )

Run the code...

Parameters
toRun
exceptionHandler
caller

◆ Times() [3/15]

void PeanutButter.Utils.MaxAttemptsRetryContext.Times ( Action toRun,
IBackoffStrategy backoffStrategy,
[CallerMemberName] string caller = null )

Run the code...

Parameters
toRun
backoffStrategy
caller

◆ Times() [4/15]

void PeanutButter.Utils.MaxAttemptsRetryContext.Times ( Action toRun,
IBackoffStrategy backoffStrategy,
Func< Exception, ExceptionHandlingStrategies > exceptionHandler,
[CallerMemberName] string caller = null )

Run the code...

Parameters
toRun
backoffStrategy
exceptionHandler
caller

◆ Times() [5/15]

void PeanutButter.Utils.MaxAttemptsRetryContext.Times ( Action< int > toRun,
[CallerMemberName] string caller = null )

Run the code...

Parameters
toRun
caller

◆ Times() [6/15]

void PeanutButter.Utils.MaxAttemptsRetryContext.Times ( Action< int > toRun,
Func< Exception, ExceptionHandlingStrategies > exceptionHandler,
[CallerMemberName] string caller = null )

Run the code...

Parameters
toRun
exceptionHandler
caller

◆ Times() [7/15]

void PeanutButter.Utils.MaxAttemptsRetryContext.Times ( Action< int > toRun,
IBackoffStrategy backoffStrategy,
[CallerMemberName] string caller = null )

Run the code...

Parameters
toRun
backoffStrategy
caller

◆ Times() [8/15]

void PeanutButter.Utils.MaxAttemptsRetryContext.Times ( Action< int > toRun,
IBackoffStrategy backoffStrategy,
Func< Exception, ExceptionHandlingStrategies > exceptionHandler,
[CallerMemberName] string caller = null )

Run the code...

Parameters
toRun
backoffStrategy
exceptionHandler
caller

◆ Times() [9/15]

async Task PeanutButter.Utils.MaxAttemptsRetryContext.Times ( Func< int, Task > toRun,
[CallerMemberName] string caller = null )

Run the code...

Parameters
toRun
caller

◆ Times() [10/15]

async Task PeanutButter.Utils.MaxAttemptsRetryContext.Times ( Func< int, Task > toRun,
Func< Exception, ExceptionHandlingStrategies > exceptionHandler,
[CallerMemberName] string caller = null )

Run the code...

Parameters
toRun
exceptionHandler
caller

◆ Times() [11/15]

async Task PeanutButter.Utils.MaxAttemptsRetryContext.Times ( Func< int, Task > toRun,
IBackoffStrategy backoffStrategy,
[CallerMemberName] string caller = null )

Run the code...

Parameters
toRun
backoffStrategy
caller

◆ Times() [12/15]

async Task PeanutButter.Utils.MaxAttemptsRetryContext.Times ( Func< int, Task > toRun,
IBackoffStrategy backoffStrategy,
Func< Exception, ExceptionHandlingStrategies > exceptionHandler,
[CallerMemberName] string caller = null )

Run the code...

Parameters
toRun
backoffStrategy
exceptionHandler
caller

◆ Times() [13/15]

async Task PeanutButter.Utils.MaxAttemptsRetryContext.Times ( Func< Task > toRun,
[CallerMemberName] string caller = null )

Run the code...

Parameters
toRun
caller

◆ Times() [14/15]

async Task PeanutButter.Utils.MaxAttemptsRetryContext.Times ( Func< Task > toRun,
Func< Exception, ExceptionHandlingStrategies > exceptionHandler,
[CallerMemberName] string caller = null )

Run the code...

Parameters
toRun
exceptionHandler
caller

◆ Times() [15/15]

async Task PeanutButter.Utils.MaxAttemptsRetryContext.Times ( Func< Task > toRun,
IBackoffStrategy backoffStrategy,
[CallerMemberName] string caller = null )

Run the code...

Parameters
toRun
backoffStrategy
caller

◆ Times< T >() [1/10]

T PeanutButter.Utils.MaxAttemptsRetryContext.Times< T > ( Func< int, T > toRun,
[CallerMemberName] string caller = null )

Run the code...

Parameters
toRun
caller

◆ Times< T >() [2/10]

T PeanutButter.Utils.MaxAttemptsRetryContext.Times< T > ( Func< int, T > toRun,
Func< Exception, ExceptionHandlingStrategies > exceptionHandler = null,
[CallerMemberName] string caller = null )

Run the code...

Parameters
toRun
exceptionHandler
caller

◆ Times< T >() [3/10]

T PeanutButter.Utils.MaxAttemptsRetryContext.Times< T > ( Func< int, T > toRun,
IBackoffStrategy backoffStrategy,
[CallerMemberName] string caller = null )

Run the code...

Parameters
toRun
backoffStrategy
caller

◆ Times< T >() [4/10]

T PeanutButter.Utils.MaxAttemptsRetryContext.Times< T > ( Func< int, T > toRun,
IBackoffStrategy backoffStrategy,
Func< Exception, ExceptionHandlingStrategies > exceptionHandler = null,
[CallerMemberName] string caller = null )

Run the code...

Parameters
toRun
backoffStrategy
exceptionHandler
caller

◆ Times< T >() [5/10]

async Task< T > PeanutButter.Utils.MaxAttemptsRetryContext.Times< T > ( Func< int, Task< T > > toRun,
[CallerMemberName] string caller = null )

Run the code...

Parameters
toRun
caller

◆ Times< T >() [6/10]

async Task< T > PeanutButter.Utils.MaxAttemptsRetryContext.Times< T > ( Func< int, Task< T > > toRun,
IBackoffStrategy backoffStrategy,
[CallerMemberName] string caller = null )

Run the code...

Parameters
toRun
backoffStrategy
caller

◆ Times< T >() [7/10]

async Task< T > PeanutButter.Utils.MaxAttemptsRetryContext.Times< T > ( Func< int, Task< T > > toRun,
IBackoffStrategy backoffStrategy,
Func< Exception, ExceptionHandlingStrategies > exceptionHandler = null,
[CallerMemberName] string caller = null )

Run the code...

Parameters
toRun
backoffStrategy
exceptionHandler
caller

◆ Times< T >() [8/10]

T PeanutButter.Utils.MaxAttemptsRetryContext.Times< T > ( Func< T > toRun,
[CallerMemberName] string caller = null )

Run the code...

Parameters
toRun
caller

◆ Times< T >() [9/10]

T PeanutButter.Utils.MaxAttemptsRetryContext.Times< T > ( Func< T > toRun,
Func< Exception, ExceptionHandlingStrategies > exceptionHandler,
[CallerMemberName] string caller = null )

Run the code...

Parameters
toRun
exceptionHandler
caller

◆ Times< T >() [10/10]

T PeanutButter.Utils.MaxAttemptsRetryContext.Times< T > ( Func< T > toRun,
IBackoffStrategy backoffStrategy,
[CallerMemberName] string caller = null )

Run the code...

Parameters
toRun
backoffStrategy
caller

◆ TimesAsync() [1/4]

async Task PeanutButter.Utils.MaxAttemptsRetryContext.TimesAsync ( Func< int, Task > toRun,
Func< Exception, Task< ExceptionHandlingStrategies > > exceptionHandler,
[CallerMemberName] string caller = null )

Run the code...

Parameters
toRun
exceptionHandler
caller

◆ TimesAsync() [2/4]

async Task PeanutButter.Utils.MaxAttemptsRetryContext.TimesAsync ( Func< int, Task > toRun,
IBackoffStrategy backoffStrategy,
Func< Exception, Task< ExceptionHandlingStrategies > > exceptionHandler,
[CallerMemberName] string caller = null )
Parameters
toRun
backoffStrategy
exceptionHandler
caller

◆ TimesAsync() [3/4]

async Task PeanutButter.Utils.MaxAttemptsRetryContext.TimesAsync ( Func< Task > toRun,
[CallerMemberName] string caller = null )

Run the provided func up to the specified number of times, or until it completes successfully.

Parameters
toRun
caller

◆ TimesAsync() [4/4]

async Task PeanutButter.Utils.MaxAttemptsRetryContext.TimesAsync ( Func< Task > toRun,
Func< Exception, Task< ExceptionHandlingStrategies > > exceptionHandler,
[CallerMemberName] string caller = null )

Run the code...

Parameters
toRun
exceptionHandler
caller

The documentation for this class was generated from the following file:
  • source/Utils/PeanutButter.Utils/MaxAttemptsRetryContext.cs