AsyncHelpers.RunSync Method

Definition

Overloads

RunSync(Func<Task>)

Execute's an async Task method which has a void return value synchronously

RunSync<T>(Func<Task<T>>)

Execute's an async TaskT method which has a T return type synchronously

RunSync(Func<Task>)

Execute's an async Task method which has a void return value synchronously

C++
public:
 static void RunSync(Func<System::Threading::Tasks::Task ^> ^ task);

Parameters

task
Func<Task>

Task method to execute

Applies to

MRTK2 Unity 2018 2.7.0 and other versions
Product Versions
MRTK2 Unity 2018 2.5.0, 2.5.1, 2.5.2, 2.5.3, 2.5.4, 2.6.0, 2.7.0
MRTK2 Unity 2019 2.5.0, 2.5.1, 2.5.2, 2.5.3, 2.5.4, 2.6.0, 2.7.0, 2.8.0
MRTK2 Unity 2020 2.5.2, 2.5.3, 2.5.4, 2.6.0, 2.7.0, 2.8.0

RunSync<T>(Func<Task<T>>)

Execute's an async TaskT method which has a T return type synchronously

C++
public:
generic <typename T>
 static T RunSync(Func<System::Threading::Tasks::Task<T> ^> ^ task);

Type Parameters

T

Return Type

Parameters

task
Func<Task<T>>

TaskT method to execute

Returns

T

Applies to

MRTK2 Unity 2018 2.7.0 and other versions
Product Versions
MRTK2 Unity 2018 2.5.0, 2.5.1, 2.5.2, 2.5.3, 2.5.4, 2.6.0, 2.7.0
MRTK2 Unity 2019 2.5.0, 2.5.1, 2.5.2, 2.5.3, 2.5.4, 2.6.0, 2.7.0, 2.8.0
MRTK2 Unity 2020 2.5.2, 2.5.3, 2.5.4, 2.6.0, 2.7.0, 2.8.0