In the previous chapter, we created our own pausable tasks (coroutines) by writing them as state machines. We created a common API for these tasks by requiring them to implement […]
Read MoreFinal thoughts – Coroutines and async/await
Before we round off this chapter, I want to point out that it should now be clear to us why coroutines aren’t really pre-emptable. If you remember back in Chapter […]
Read MoreIMPORTANT – Coroutines and async/await
There is one subtle point to make a note of here. The first time JoinAll::poll is called, it will call poll on each future in the collection. Polling each future […]
Read Morec-async-await-concurrent futures – Coroutines and async/await
Okay, so we’ll build on the last example and do just the same thing. Create a new project called c-async-await and copy Cargo.toml and everything in the src folder over. […]
Read MoreNOTE – Coroutines and async/await
For convenience, there is a file called original_main.rs in the root of the project that contains the code for main.rs that we presented, so you don’t need to save the […]
Read MoreNOTE – Coroutines and async/await-1
We could have simply defined Coroutine as an enum since the only state it holds is an enum indicating its state. But, we’ll set up this example so we can […]
Read More