Experimenting with our runtime
Note
You’ll find this example in the book’s repository in the ch1
0
/b-rust-futures-experiments
folder. The different experiments will be implemented as different versions of the async_main
function numbered chronologically. I’ll indicate which function corresponds with which function in the repository example in the heading of the code snippet.
Before we start experimenting, let’s copy everything we have now to a new folder:
- Create a new folder called
b-rust-futures-experiments
. - Copy everything from the
a-rust-futures
folder to the new folder. - Open
Cargo.toml
and change thename
attribute tob-rust-futures-experiments
.
The first experiment will be to exchange our very limited HTTP client with a proper one.
The easiest way to do that is to simply pick another production-quality HTTP client library that supports async Rust and use that instead.
So, when trying to find a suitable replacement for...