This is an educational project built to understand async runtimes in Rust
It contains 3 separate runtimes, each of which is slightly more complex than the last:
- The first is a very simple runtime which shows an executor which polls futures to completion.
- The second is an event loop combined with a reactor.
- The third is a simple scheduler combined with a reactor, which can be used to poll futures to completion.
To run any runtime, simply go into the folder for the runtime and just do cargo build
followed by cargo run
. Repos 2 & 3 will start up a TCP server to which you can then send requests.
There is a test client application located in the folders for 2 & 3 used to simulate network requests. You can run rustc ./src/async_runtime/test_client.rs
and this will produce a binary called test_client
in the root directory. Once you have the server running, do ./test_client
in a separate tab to send some requests.
There are 3 accompanying blog posts - one for each section
- https://redixhumayun.github.io/async/2024/08/05/async-runtimes.html
- https://redixhumayun.github.io/async/2024/09/18/async-runtimes-part-ii.html
- https://redixhumayun.github.io/async/2024/10/10/async-runtimes-part-iii.html
Have fun :)
There are a number of useful references that I found while attempting to build this out
- This playlist by nyxtom on YouTube
- The repo for the playlist above
- Async Rust Book
- Asynchronous Programming In Rust
I've linked far more references in the blog posts above but the references here proved to be the most helpful to me