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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.