What are use cases for coroutines?
One use case is a web server that has multiple simultaneous connections, with a requirement to schedule reading and writing in parallel with all of them. This can be implemented using coroutines. Each connection is a coroutine that reads/writes some amount of data, then yields control to the scheduler. The scheduler passes to the next … Read more