CQRS.NET  2.1
A lightweight enterprise framework to write CQRS, event-sourced and micro-service applications in hybrid multi-datacentre, on-premise and Azure environments.

◆ SpinUntil() [3/3]

static bool Cqrs.Infrastructure.SpinWait.SpinUntil ( Func< bool >  condition,
int  millisecondsTimeout,
short  sleepInMilliseconds = 0 
)
static

Spins until the specified condition is satisfied or until the specified timeout is expired.

Returns
True if the condition is satisfied within the timeout; otherwise, false
Parameters
conditionA delegate to be executed over and over until it returns true.
millisecondsTimeoutThe number of milliseconds to wait, or F:System.Threading.Timeout.Infinite (-1) to wait indefinitely.
sleepInMillisecondsThe amount of milliseconds the thread will sleep for.
Exceptions
T:System.ArgumentNullExceptionThe condition argument is null.
T:System.ArgumentOutOfRangeExceptionmillisecondsTimeout is a negative number other than -1, which represents an infinite time-out.