The final part of our example is the Reactor. Our Reactor will: When we’re done with this step, we should have everything we need for our runtime, so let’s get […]
Read MoreA QUICK NOTE ABOUT STATIC LIFETIMES – Runtimes, Wakers, and the Reactor-Executor Pattern-2
block_on will be the entry point to our Executor. Often, you will pass in one top-level future first, and when the top-level future progresses, it will spawn new top-level futures […]
Read MoreA QUICK NOTE ABOUT STATIC LIFETIMES – Runtimes, Wakers, and the Reactor-Executor Pattern-1
When a ‘static lifetime is used as a trait bound as we do here, it doesn’t actually mean that the lifetime of the Future trait we pass in must be […]
Read MoreImplementing a proper Executor – Runtimes, Wakers, and the Reactor-Executor Pattern-1
In this step, we’ll create an executor that will: Note It’s worth mentioning that our executor won’t be fully multithreaded in the sense that tasks/futures can’t be sent from one […]
Read MoreCreating a Waker – Runtimes, Wakers, and the Reactor-Executor Pattern
So, we need to find a different way for our executor to sleep and get woken up that doesn’t rely directly on Poll. It turns out that this is quite […]
Read MoreImproving our runtime design by adding a Reactor and a Waker – Runtimes, Wakers, and the Reactor-Executor Pattern
In this step, we’ll make the following changes: Tip You’ll find this example in the ch08/b-reactor-executor folder. If you follow along by writing the examples from the book, I suggest […]
Read MoreNOTE – Runtimes, Wakers, and the Reactor-Executor Pattern
If you run the example on Windows, you’ll see that you get two Schedule other tasks messages after each other. The reason for that is that Windows emits an extra […]
Read MoreChanging the current implementation – Runtimes, Wakers, and the Reactor-Executor Pattern-1
Now that we have an overview of our design and know what to do, we can go on and make the necessary changes to our program, so let’s go through […]
Read MoreImproving our base example – Runtimes, Wakers, and the Reactor-Executor Pattern
We’ll create a version of the first example in Chapter 7 since it’s the simplest one to start with. Our only focus is showing how to schedule and drive the […]
Read MoreTechnical requirements – Runtimes, Wakers, and the Reactor-Executor Pattern
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 More