Run Method

Task.Run Method

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

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:
© 2017 Microsoft