The Workflow

Discover a dynamic aspect of coroutines called workflow.

We'll cover the following

The compiler transforms your coroutine and runs two workflows: the outer promise workflow and the inner awaiter workflow.

The promise workflow

When you use co_yield, co_await, or co_return in a function, the function becomes a coroutine, and the compiler transforms its body to something equivalent to the following lines.

Get hands-on with 1200+ tech skills courses.