System.Threading.Tasks.Task.Run Method

Queues the specified work to run on the ThreadPool and returns a proxy for the task returned by function.

Syntax

public static Task Run (Func<Task> function, System.Threading.CancellationToken cancellationToken)

Parameters

function
The work to execute asynchronously
cancellationToken
A cancellation token that should be used to cancel the work

Returns

A task that represents a proxy for the task returned by function.

Remarks

Documentation for this section has not yet been entered.

Requirements

Namespace: System.Threading.Tasks
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 4.0.0.0