Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
MSDN Library
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

Task.Run Method

Queues the specified work to run on the ThreadPool and returns a Task or Task(TResult) handle for that work.

This member is overloaded. For complete information about this member, including syntax, usage, and examples, click a name in the overload list.

  NameDescription
Public method Static member Run(Action) Queues the specified work to run on the ThreadPool and returns a Task handle for that work.
Public method Static member Run<TResult>(Func<Task<TResult>>) Queues the specified work to run on the ThreadPool and returns a proxy for the Task(TResult) returned by function.
Public method Static member Run(Func<Task>) Queues the specified work to run on the ThreadPool and returns a proxy for the Task returned by function.
Public method Static member Run<TResult>(Func<TResult>) Queues the specified work to run on the ThreadPool and returns a Task(TResult) handle for that work.
Public method Static member Run(Action, CancellationToken) Queues the specified work to run on the ThreadPool and returns a Task handle for that work.
Public method Static member Run<TResult>(Func<Task<TResult>>, CancellationToken) Queues the specified work to run on the ThreadPool and returns a proxy for the Task(TResult) returned by function.
Public method Static member Run(Func<Task>, CancellationToken) Queues the specified work to run on the ThreadPool and returns a proxy for the Task returned by function.
Public method Static member Run<TResult>(Func<TResult>, CancellationToken) Queues the specified work to run on the ThreadPool and returns a Task(TResult) handle for that work.
Top

Show:
© 2015 Microsoft