TaskExt.WaitUntil Method (Func(Boolean), Int32, CancellationToken)
Creates an awaitable task that blocks until a condition is true, a timeout occurs or the task is canceled.
Namespace: UltimateXR.Extensions.System.Threading
Assembly: UltimateXR (in UltimateXR.dll) Version: 0.0.0.0
Syntax
C#
public static Task WaitUntil(
Func<bool> condition,
int timeout,
CancellationToken ct = default
)
Parameters
- condition
- Type: System.Func(Boolean)
The condition that will perpetuate the block - timeout
- Type: System.Int32
Timeout, in milliseconds - ct (Optional)
- Type: System.Threading.CancellationToken
Optional cancellation token, to cancel the task
Return Value
Exceptions
Exception | Condition |
---|---|
TimeoutException | Thrown after [!:timeout] milliseconds |
See Also
Reference
TaskExt Class
WaitUntil Overload
UltimateXR.Extensions.System.Threading Namespace