Method TryWaitAsync
TryWaitAsync(CancellationToken)
Asynchronously waits before another attempt if the time limit has not passed.
Declaration
public ValueTask<bool> TryWaitAsync(CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| CancellationToken | cancellationToken | A token that cancels the wait. |
Returns
| Type | Description |
|---|---|
| ValueTask<bool> | A task that contains true after the wait if another attempt can be made, or false without waiting if the time limit has passed. |
Remarks
The wait is the delay, or the time left until the time limit passes if that is shorter, rounded up to whole milliseconds. When the time limit has passed, the returned task has already completed and nothing is allocated.
Exceptions
| Type | Condition |
|---|---|
| OperationCanceledException |
|