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

Retries operations up to a specific number of times. More...

Static Public Member Functions

static MaxAttemptsRetryContext Max (int maxAttempts)
 Set the max number of runs to allow.
 
static TimeBasedRetryContext Until (DateTime timeout)
 Continues to retry the provided operation until the given timeout.
 
static TimeBasedRetryContext Until (TimeSpan maxRunTime)
 Continues to retry the provided operation until the given timeout.
 
static void InstallDefaultBackoffStrategy (IBackoffStrategy backoffStrategy)
 installs a default backoff strategy to use other than the DefaultBackoffStrategy of PeanutButter.Utils so you don't have to specify the strategy every time
 
static void InstallDefaultBackoffStrategy (Func< IBackoffStrategy > factory)
 installs a factory for the default backoff strategy to use other than the DefaultBackoffStrategy of PeanutButter.Utils so you don't have to specify the strategy every time
 
static void ForgetDefaultBackoffStrategy ()
 Corollary to InstallDefaultBackoffStrategy.
 

Detailed Description

Retries operations up to a specific number of times.

Member Function Documentation

◆ ForgetDefaultBackoffStrategy()

static void PeanutButter.Utils.Retry.ForgetDefaultBackoffStrategy ( )
static

Corollary to InstallDefaultBackoffStrategy.

  • will uninstall the default (if any) such that DefaultBackoffStrategy from PeanutButter.Utils is used instead

◆ InstallDefaultBackoffStrategy() [1/2]

static void PeanutButter.Utils.Retry.InstallDefaultBackoffStrategy ( Func< IBackoffStrategy factory)
static

installs a factory for the default backoff strategy to use other than the DefaultBackoffStrategy of PeanutButter.Utils so you don't have to specify the strategy every time

Parameters
factory

◆ InstallDefaultBackoffStrategy() [2/2]

static void PeanutButter.Utils.Retry.InstallDefaultBackoffStrategy ( IBackoffStrategy  backoffStrategy)
static

installs a default backoff strategy to use other than the DefaultBackoffStrategy of PeanutButter.Utils so you don't have to specify the strategy every time

Parameters
backoffStrategy

◆ Max()

static MaxAttemptsRetryContext PeanutButter.Utils.Retry.Max ( int  maxAttempts)
static

Set the max number of runs to allow.

Parameters
maxAttempts
Returns

◆ Until() [1/2]

static TimeBasedRetryContext PeanutButter.Utils.Retry.Until ( DateTime  timeout)
static

Continues to retry the provided operation until the given timeout.

Parameters
timeout
Returns

◆ Until() [2/2]

static TimeBasedRetryContext PeanutButter.Utils.Retry.Until ( TimeSpan  maxRunTime)
static

Continues to retry the provided operation until the given timeout.

Parameters
maxRunTime
Returns

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