Skip to content
Free public beta until December 4, 2026: every course is open, no card needed. After that, the first chapter of each course stays free and full access is a one-time $39 ($19 for up to 100 founding members chosen for helpful feedback). Your progress is kept. How the beta works

async runtime

The library that runs async tasks: it polls futures and wakes them when their I/O is ready.

Rust ships no runtime; Tokio provides an executor (a scheduler of tasks on one or many worker threads), timers, and non-blocking I/O, started by #[tokio::main].

Examples

  • async fn main on its own fails with E0752 (main function is not allowed to be async); #[tokio::main] wraps it in a runtime that polls it.

  • futures::executor::block_on(fut) is the smallest executor: it runs one future on the current thread until it finishes.

Read the full section →