Top "Taskcompletionsource" questions

TaskCompletionSource produces a Task<TResult> unbound to a delegate, providing access to the consumer side through the Task property.

When should TaskCompletionSource<T> be used?

AFAIK, all it knows is that at some point, its SetResult or SetException method is being called to complete the …

c# .net .net-4.0 task-parallel-library taskcompletionsource
Timeout an async method implemented with TaskCompletionSource

I have a blackbox object that exposes a method to kick of an async operation, and an event fires when …

c# asynchronous timeout async-await taskcompletionsource
TaskCompletionSource throws "An attempt was made to transition a task to a final state when it had already completed"

I want to use TaskCompletionSource to wrap MyService which is a simple service: public static Task<string> ProcessAsync(…

c# .net asynchronous async-await taskcompletionsource
How to combine TaskCompletionSource and CancellationTokenSource?

I have such code (simplified here) which awaits finishing task: var task_completion_source = new TaskCompletionSource<bool>(); observable.…

c# asynchronous async-await cancellationtokensource taskcompletionsource
How to cancel a TaskCompletionSource using a timeout

I have the function that I call asynchronously using the await keyword: public Task<StatePropertyEx> RequestStateForEntity(EntityKey entity, …

c# async-await taskcompletionsource