Now that our Reactor is set up, we only have two short functions left. The first one is event_loop, which will hold the logic for our event loop that waits […]
Read MoreImplementing a proper Reactor – Runtimes, Wakers, and the Reactor-Executor Pattern-1
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 MoreImplementing a proper Executor – Runtimes, Wakers, and the Reactor-Executor Pattern-2
ExecutorCore holds all the state for our Executor: ExecutorCore derives the Default trait since there is no special initial state we need here, and it keeps the code short and […]
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 MoreCreating a proper runtime – Runtimes, Wakers, and the Reactor-Executor Pattern
So, if we visualize the degree of dependency between the different parts of our runtime, our current design could be described this way: Figure 8.5 – Tight coupling between reactor […]
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 MoreDesign – Runtimes, Wakers, and the Reactor-Executor Pattern
Before we go any further, let’s visualize how our system is currently working if we consider it with two futures created by coroutine/wait and two calls to Http::get. The loop […]
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 More