Tasks and the Event-based Asynchronous Pattern
As has been discussed previously, one of the new features in the Task Parallel Library is TaskCompletionSource<TResult> , which enables the creation of a Task<TResult> that represents any other asynchronous operation. There are a wide variety of sources in the .NET Framework for asynchronous work. One comes from components that implement the Asynchronous Programming Model (APM) pattern, which we discussed here . Another includes types that implement the Event-based Asynchronous Pattern (EAP). For some synchronous method Xyz, the EAP provides an asynchronous counterpart XyzAsync. Calling this method launches the asynchronous work, and when the work completes, a corresponding XyzCompleted event is raised.
Read the original post:
Tasks and the Event-based Asynchronous Pattern


