Creates a new Task for the target Dispatcher (default: the main Dispatcher) based upon the given function. This method will wait for the task completion and returns the return value.

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

Syntax

C#
public T DispatchAndWait<T>(
	Func<T> function
)
Visual Basic
Public Function DispatchAndWait(Of T) ( _
	function As Func(Of T) _
) As T
Visual C++
public:
generic<typename T>
T DispatchAndWait(
	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 return value of the tasks function.

See Also