O'Reilly logo

C# 5.0 Unleashed by Bart De Smet

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Task-Based Asynchronous Pattern (TAP)

The introduction of the Task type in .NET 4.0 provides for a way to standardize on the object representation of an operation’s eventual completion. In fact, tasks are sometimes referred to as futures, clearly indicating their nature of having a result in the future.

Looking back at the APM, you might wonder whether we don’t already have such a type in the form of the IAsyncResult interface. Although they share some similarities, a couple of drawbacks apply to using this type when representing futures. One problem is the separation of callbacks from the object representing the operation. Another one is the absence of the operation’s result on the IAsyncResult object itself. In other words, this type can’t ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required