See Also: TaskCompletionSource<TResult> Members
- Documentation for this section has not yet been entered.
In many scenarios, it is useful to enable a System.Threading.Tasks.Task`1 to represent an external asynchronous operation. System.Threading.Tasks.TaskCompletionSource`1 is provided for this purpose. It enables the creation of a task that can be handed out to consumers, and those consumers can use the members of the task as they would any other. However, unlike most tasks, the state of a task created by a TaskCompletionSource is controlled explicitly by the methods on TaskCompletionSource. This enables the completion of the external asynchronous operation to be propagated to the underlying Task. The separation also ensures that consumers are not able to transition the state without access to the corresponding TaskCompletionSource. For more information, see the entry tp://blogs.msdn.com/b/pfxteam/archive/2009/06/02/9685804.aspx in the Parallel Programming with .NET blog.