Sphyrnidae Common Library  2.0.1
Shared Utilities/Library
Sphyrnidae.Common.RetryMethod.Retry Class Reference

Retry logic for execution of a method More...

Static Public Member Functions

static async Task< T > Do< T > (Func< Task< T >> method, RetryOptions options=null)
 Performs the method until success or retry limit reached More...
 
static async Task< T > Do< T > (Func< T > method, RetryOptions options=null)
 Performs the method until success or retry limit reached More...
 
static async Task< bool > Do (Func< Task > method, RetryOptions options=null)
 Performs the method until success or retry limit reached More...
 
static async Task< bool > Do (Action method, RetryOptions options=null)
 Performs the method until success or retry limit reached More...
 

Detailed Description

Retry logic for execution of a method

Member Function Documentation

◆ Do() [1/2]

static async Task<bool> Sphyrnidae.Common.RetryMethod.Retry.Do ( Action  method,
RetryOptions  options = null 
)
static

Performs the method until success or retry limit reached

Parameters
methodThe method to execute in the retry loop
optionsRetry options to customize the retry logic (Optional, default = new RetryOptions())
Returns
true if succeeded, or false/throw exception (based on configuration)

◆ Do() [2/2]

static async Task<bool> Sphyrnidae.Common.RetryMethod.Retry.Do ( Func< Task >  method,
RetryOptions  options = null 
)
static

Performs the method until success or retry limit reached

Parameters
methodThe method to execute in the retry loop
optionsRetry options to customize the retry logic (Optional, default = new RetryOptions())
Returns
true if succeeded, or false/throw exception (based on configuration)

◆ Do< T >() [1/2]

static async Task<T> Sphyrnidae.Common.RetryMethod.Retry.Do< T > ( Func< T >  method,
RetryOptions  options = null 
)
static

Performs the method until success or retry limit reached

Template Parameters
TThe type of response
Parameters
methodThe method to execute in the retry loop
optionsRetry options to customize the retry logic (Optional, default = new RetryOptions())
Returns
T, or default if not succeeded (or throws if so configured)

◆ Do< T >() [2/2]

static async Task<T> Sphyrnidae.Common.RetryMethod.Retry.Do< T > ( Func< Task< T >>  method,
RetryOptions  options = null 
)
static

Performs the method until success or retry limit reached

Template Parameters
TThe type of response
Parameters
methodThe method to execute in the retry loop
optionsRetry options to customize the retry logic (Optional, default = new RetryOptions())
Returns
T, or default if not succeeded (or throws if so configured)

The documentation for this class was generated from the following file: