About This eBook by Bart De Smet

Safari, the world’s most comprehensive technology and business learning platform.

Find the exact information you need to solve a problem on the fly, or go deeper to master the technologies and skills you need to succeed

Start Free Trial

No credit card required

O'Reilly logo

Implementing a TAP Method, Take One

Even though the easiest way to implement TAP methods is by using the new async modifier on a method declaration, we start off by examining a few handcrafted TAP methods. This will clearly illustrate the nature of the Task-based approach to signal the eventual completion of the method’s operation. Later in this chapter, you will learn how to simplify this by using asynchronous methods.

The key aspect to providing a TAP-based method is to return a Task or Task<T> object as soon as possible, which prevents the caller of the method from getting stuck. At a later point in time, this task gets set to let the caller know a result is available. Therefore, there are two sides to a task object: the receiving end (consumer) ...

Find the exact information you need to solve a problem on the fly, or go deeper to master the technologies and skills you need to succeed

Start Free Trial

No credit card required