When should TaskCompletionSource be used?

AFAIK, all it knows is that at some point, its SetResult or SetException method is being called to complete the Task<T> exposed through its Task property. In other words, it acts as the producer for a Task<TResult> and its completion. I saw here the example: If I need a way to execute a Func<T> asynchronously … Read more