Skip to content

DurableTask.Run(Func<Task<TResult>>)

Run(Func<Task<TResult>>)

static
View source
public static DurableTask<TResult> Run<TResult>(Func<Task<TResult>> function)
Creates an unstarted step. It runs function when it is awaited, scheduled, or posted, possibly in a later turn, as a child execution with its own DurableTask and cancellation scope. Unlike System.Threading.Tasks.Task.Run, creating it starts nothing, and nothing runs on the thread pool.

Parameters

functionFunc<Task<TResult>>
The asynchronous function which the child runs.

Returns

A definition which runs the function each time it is awaited, scheduled, or posted.

Exceptions

System.ArgumentNullException
function is null.