Creates a new Task for the target Dispatcher (default: the main Dispatcher) based upon the given function.

Namespace: UnityThreading
Assembly: UnityThreading (in UnityThreading.dll) Version: 1.0.0.0 (1.0.0.0)

Syntax

C#
public Task<T> Dispatch<T>(
	Func<T> function
)
Visual Basic
Public Function Dispatch(Of T) ( _
	function As Func(Of T) _
) As Task(Of T)
Visual C++
public:
generic<typename T>
Task<T>^ Dispatch(
	Func<T>^ function
)

Parameters

function
Type: System..::..Func<(Of <(<'T>)>)>
The function to process at the dispatchers thread.

Type Parameters

T
The return value of the task.

Return Value

The new task.

See Also