Note While I use 12 cores, you should use the number of cores on your machine. If we increase this number too much, our OS will not be able to […]
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 MoreChanging the Future definition – Runtimes, Wakers, and the Reactor-Executor Pattern
How does this Waker compare to the one in the standard library? The Waker we create here will take the same role as the Waker type from the standard library. […]
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 MoreChanging the current implementation – Runtimes, Wakers, and the Reactor-Executor Pattern-2
The next function is the block_on function. I’ll go through it step by step: If the future returns NotReady, we write out a message letting us know that at this […]
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 MoreIntroduction to runtimes and why we need them – Runtimes, Wakers, and the Reactor-Executor Pattern
As you know by now, you need to bring your own runtime for driving and scheduling asynchronous tasks in Rust. Runtimes come in many flavors, from the popular Embassy embedded […]
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