Key Takeaways of the TAP

To conclude our discussion of the new Task-based Asynchronous Pattern, we’ll sum up its key properties.

Compared to the classic APM and EAP approaches, one of the strengths of the TAP is its single-method nature. All aspects of kicking off the operation, awaiting its successful or exceptional result, cancellation, and progress tracking are present on a single method signature. One of the key enablers for this is the Task<T> type.

While consuming a TAP method without dedicated language support is still quite involved—using the ContinueWith method—you will see how this is made simpler using the new C# 5.0 await expression. But even without this language support, things have gotten much more streamlined. For example, the ...

Get C# 5.0 Unleashed now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.