Futures in Rust 132 A fully working async system in Rust can be divided into three parts: Reactor (responsible for notifying about I/O events) Executor (scheduler) Future (a task that can stop and resume at specific points) So, how do these three parts work together? Let's take a look at a diagram that shows a simplified overview of an async runtime: Figure 6. 1-Reactor, executor, and waker In step 1 of the figure, an executor holds a list of futures. It will try to run the future by polling it (the poll phase), and when it does, it hands it a Waker. The future either returns Poll:Ready (which means it's finished) or Poll::Pending (which means it's not done but can't get further at the moment). When the executor receives one of these results, it knows it can start polling a different future. We call these points where control is shifted back to the executor yield points. In step 2, the reactor stores a copy of the Waker that the executor passed to the future when it polled it. The reactor tracks events on that I/O source, usually through the same type of event queue that we learned about in Chapter 4. 