Runtimes, Wakers, and the Reactor-Executor Pattern 200 Provide the necessary mechanisms for leaf futures such as Http Get Future, to register and deregister interests in events Provide a way for leaf futures to store the last received Waker When we're done with this step, we should have everything we need for our runtime, so let's get to it. Start by opening the reactor. rs file. The first thing we do is add the dependencies we need: ch08/b-reactor-executor/src/runtime/reactor. rs use crate::runtime::Waker; use mio::{net::Tcp Stream, Events, Interest, Poll, Registry, Token}; use std::{ collections::Hash Map, sync::{ atomic::{Atomic Usize, Ordering}, Arc, Mutex, Once Lock, }, thread, }; After we've added our dependencies, we create a type alias called Wakers that aliases the type for our wakers collection: ch08/b-reactor-executor/src/runtime/reactor. rs type Wakers = Arc<Mutex<Hash Map<usize, Waker>>>; The next line will declare a static variable called REACTOR : ch08/b-reactor-executor/src/runtime/reactor. rs static REACTOR: Once Lock<Reactor> = Once Lock::new(); This variable will hold a Once Lock<Reactor>. In contrast to our CURRENT_EXEC static variable, this will be possible to access from different threads. Once Lock allows us to define a static variable that we can write to once so that we can initialize it when we start our Reactor. By doing so, we also make sure that there can only be a single instance of this specific reactor running in our program. The variable will be private to this module, so we create a public function allowing other parts of our program to access it: