This is an example of a simple program that uses the sans-io
pattern.
It's split across three crates
ping-core
Which implements the core logic in a sans-io way.ping-sync
Which provides a binary aroundping-core
that uses synchronous IO.ping-tokio
Which provides a binary aroundping-core
that uses Tokio.
To build and run the synchronous version:
$ cargo build && sudo target/debug/ping-sync
and for the Tokio version:
$ cargo build && sudo target/debug/ping-tokio
This example was used in a talk at Rust Edinburgh on the 20th of March 2025.
The slides can be found in slides.md
and viewed via presenterm