The author of Boost.Asio, around 2009-2010, implemented a very cool concept, co-routines, to help you design asynchronous applications even easier.
They allow you to have the best of both worlds, that is, write asynchronous applications and easily follow the flow of control, almost as if the application was written sequentially.
The normal flow is shown in case 1. Using co-routines, you'll get as close to case two as possible.
Simply put, a co-routine allows multiple entry points for suspending and resuming execution at certain locations within a function.
If you are to use co-routines, you'll need two header files that are only found ...