Skip to content

DurableTaskExtensions.WaitAsync(DurableTask<TResult>, TimeSpan)

WaitAsync(DurableTask<TResult>, TimeSpan)

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

Parameters

taskDurableTask<TResult>
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.