When should TaskCompletionSource be used?
I mostly use it when only an event based API is available (for example Windows Phone 8 sockets): public Task<Args> SomeApiWrapper() { TaskCompletionSource<Args> tcs = new TaskCompletionSource<Args>(); var obj = new SomeApi(); // will get raised, when the work is done obj.Done += (args) => { // this will notify the caller // of the … Read more