Skip to content

DurableTaskExtensions.WaitAsync(DurableTask, TimeSpan)

WaitAsync(DurableTask, TimeSpan)

staticextension
View source
public static DurableTask WaitAsync(this DurableTask task, TimeSpan timeout)
Creates a durable task which runs task and requests its durable cancellation once timeout elapses.

Parameters

taskDurableTask
The task to run.
timeoutTimeSpan
The time to wait before requesting cancellation, which is zero or positive.

Returns

A combinator which, awaited within a durable execution, runs as part of that execution and completes once task is terminal.

Exceptions

System.ArgumentNullException
task is null.
System.ArgumentOutOfRangeException
timeout is negative, including System.Threading.Timeout.InfiniteTimeSpan; await the task itself to wait without a timeout.