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() [2/3]

static bool Cqrs.Infrastructure.SpinWait.SpinUntil ( Func< bool >  condition,
TimeSpan  timeout,
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.
timeoutA T:System.TimeSpan that represents the number of milliseconds to wait, or a TimeSpan that represents -1 milliseconds to wait indefinitely.
sleepInMillisecondsThe amount of milliseconds the thread will sleep for.
Exceptions
T:System.ArgumentNullExceptionThe condition argument is null.
T:System.ArgumentOutOfRangeExceptiontimeout is a negative number other than -1 milliseconds, which represents an infinite time-out -or- timeout is greater than F:System.Int32.MaxValue.