WaitRetry

Retrying class which waits for a specified amount of time before each retry.

Constructors

this
this(uint retry_wait_ms, SuccessDecider success_decide)

Constructor.

Members

Functions

on_retry
void on_retry()

Wait on retry.

Static functions

sleep
void sleep(time_t ms)

Sleep in a multi-thread compatible way. sleep() in multiple threads is not trivial because when several threads simultaneously sleep and the first wakes up, the others will instantly wake up, too. See nanosleep() man page

Inherited Members

From Retry

SuccessDecider
alias SuccessDecider = bool delegate(lazy void)

Alias for a delegate which executes a code block and decides if it has succeeded or failed.

loop
void loop(uint max_retries, void dg)

Initiates the execution and possible retrying of a block of code.

opCall
alias opCall = loop
Undocumented in source.
retry_decide
bool retry_decide()

Decides whether to keep retrying or to give up.

on_retry
void on_retry()

Called before a retry is commenced. The base class behaviour does nothing, but it can be overridden by derived classes to implement special behaviour on retry.

Meta