Technical requirements
The examples in this chapter will build on the code from the last chapter, so the requirements are the same. The example is cross-platform and will work on all platforms that Rust (https://doc.rust-lang.org/beta/rustc/platform-support.html#tier-1-with-host-tools) and mio
(https://github.com/tokio-rs/mio#platforms) support.
The only thing you need is Rust installed and the book’s repository downloaded locally. All the code in this chapter can be found in the ch10
folder.
We’ll use delayserver
in this example as well, so you need to open a separate terminal, enter the delayserver
folder at the root of the repository, and type cargo run
so it’s ready and available for the examples going forward.
Remember to change the ports in the code if for some reason you have to change what port delayserver
listens on.
Creating our own runtime with futures and async/await
Okay, so we’re in the home stretch; the last thing we’ll...