DotNext by .NET Foundation and Contributors

<PackageReference Include="DotNext" Version="4.0.0-beta.4" />

 Synchronization

public static class Synchronization
Represents task synchronization and combination methods.
public static Result<TResult> GetResult<TResult>(this Task<TResult> task, TimeSpan timeout)

Gets task result synchronously.

public static Result<TResult> GetResult<TResult>(this Task<TResult> task, CancellationToken token)

Gets task result synchronously.

public static Result<object> GetResult(this Task task, CancellationToken token)

Gets task result synchronously.

public static Result<object> GetResult(this Task task, TimeSpan timeout)

Gets task result synchronously.

public static Task<ValueTuple<T1, T2>> WhenAll<T1, T2>(Task<T1> task1, Task<T2> task2)

Creates a task that will complete when all of the passed tasks have completed.

public static Task<ValueTuple<T1, T2, T3>> WhenAll<T1, T2, T3>(Task<T1> task1, Task<T2> task2, Task<T3> task3)

Creates a task that will complete when all of the passed tasks have completed.

public static Task<ValueTuple<T1, T2, T3, T4>> WhenAll<T1, T2, T3, T4>(Task<T1> task1, Task<T2> task2, Task<T3> task3, Task<T4> task4)

Creates a task that will complete when all of the passed tasks have completed.

public static Task<ValueTuple<T1, T2, T3, T4, T5>> WhenAll<T1, T2, T3, T4, T5>(Task<T1> task1, Task<T2> task2, Task<T3> task3, Task<T4> task4, Task<T5> task5)

Creates a task that will complete when all of the passed tasks have completed.