From the course: Asynchronous Programming in C#

Unlock the full course today

Join today to access over 24,700 courses taught by industry experts.

Using continuations

Using continuations

- [Instructor] Continuations are tasks that are invoked by other tasks. They perform much the same role as a callback function in other asynchronous programming models. They start when an antecedent or previous task completes. If the asynchronous work performed by the task returns some data, you can use the continuation to receive and process that data without blocking your user interface. Continuations are very flexible and may be associated with one or multiple antecedents. For instance, you could configure a continuation to begin after a single task completes, but if you have several tasks executing at the same time, you could configure a single continuation to begin only after all of the tasks are complete or just after any one of them finishes. You can exert even more granular control over the execution of a continuation with the task continuation options enum. It includes lots of additional options such as only…

Contents