Find Related products on Amazon

Shop on Amazon

A Visual Journey Through Async Rust

Published on: 2025-08-13 20:50:35

A Visual Journey Through Async Rust I'm a visual and experimental learner. To truly understand something, I need to tinker with it and see it run with my own eyes. To truly understand async execution, I want to visualize it. What order are things happening in? Do concurrent futures affect each other? How do tasks and threads relate? Plotting network calls or file system operations is boring. Let's draw something. Visualization All visualization code is available here To visualize the passing of time, we'll plot out some shape. A simple sine wave will do nicely. First, we create a future that asynchronously computes N values of the sine function. In each iteration, we compute a value and yield_now().await to yield execution to other futures. We send these computed values to a channel and later use matplotlib and pyo3 to graphically display the results. /// Each calculated sine value is a sample we keep track of struct Sample { fut_name : String , value : f32 , t : u128 } async fn ... Read full article.