Awaitable

This lesson explains the awaitable concept in C#

We'll cover the following...

Awaitable

In our previous example, we have used the await operator with objects of type Task. What types are allowed to be used with the await operator? The requirements are as follows:

  • The type should have a method GetAwaiter() that returns an instance of a class satisfying specific properties. Say if the return type is class X then it must meet the following bullet points.

  • X must implement the interface INotifyCompletion and optionally the ICriticalNotifyCompletion interface.

  • ...