Nito.AsyncEx.TaskCompletionSourceExtensions
Provides extension methods for TaskCompletionSource<T>.
Creates a new TCS for use with async code, and which forces its continuations to execute asynchronously.
public static bool TryCompleteFromCompletedTask<TResult, TSourceResult>(this TaskCompletionSource<TResult> this, Task<TSourceResult> task) where TSourceResult : TResult
Attempts to complete a TaskCompletionSource<T>, propagating the completion of task.
public static bool TryCompleteFromCompletedTask<TResult>(this TaskCompletionSource<TResult> this, Task task, Func<TResult> resultFunc)
Attempts to complete a TaskCompletionSource<T>, propagating the completion of task but using the result value from resultFunc if the task completed successfully.