Skip to content

ScheduledTask.WaitUntilAsync(DateTimeOffset, CancellationToken)

WaitUntilAsync(DateTimeOffset, CancellationToken)

View source
public Task WaitUntilAsync(DateTimeOffset dueTime, CancellationToken cancellationToken = default(CancellationToken))
Waits for successful completion, and requests durable cancellation of the task once dueTime passes.

Parameters

dueTimeDateTimeOffset
The time at which to request cancellation. A time which has passed times out promptly.
cancellationTokenCancellationToken
A token which abandons the wait. It doesn't cancel the task.

Returns

An operation which completes once the task is terminal.

Exceptions

System.ArgumentOutOfRangeException
Outside a durable execution, the time until dueTime exceeds the longest timer interval which System.Threading.CancellationTokenSource.CancelAfter accepts.
System.TimeoutException
The due time passed, and the task ended canceled.