Loading tutorials
std::thread is helpful. Later chapters cover polling and the Tokio runtime in detail. Here you only need the basic model.2 min readasync fn and .await give you, and that you are comfortable with traits and Pin at a basic level. It shows what happens underneath an .await.2 min readasync fn and .await produce futures, and that a future is advanced by calls to poll with a Waker. It also assumes basic Cargo use. Here we look at what has to exist outside the future for it to make progress.2 min readasync fn and .await do, and that a runtime polls futures. Here you will start a Tokio runtime and see what #[tokio::main] does for you.2 min read#[tokio::main] and spawn tasks with tokio::spawn. It covers the two runtime flavors Tokio offers and how to configure them.2 min read#[tokio::main]. You should also know that an async fn returns a future that does nothing until it is polled.2 min readArc and Mutex from std. It also assumes you can already spawn a task with tokio::spawn.2 min readtokio::spawn, and that you know Rust's Result, Option, and ? operator. It covers how to get a value back from a task and what happens when the task fails.2 min read#[tokio::main] and spawn tasks. It covers the three tools you need to wait on the outside world without blocking a thread: async I/O, sleep, and timeout.2 min readasync fn and .await, can start a Tokio runtime with #[tokio::main], and understand tokio::spawn. It covers two macros that combine futures inside a single task: join! waits for all of them, and select! waits for the first.2 min readtokio::spawn and that you know why spawned tasks must be Send + 'static. Instead of sharing memory, tasks can pass values through a channel. A channel is a queue with a sending end and a receiving end.2 min readArc, Mutex and move closures from std threads, and that you can spawn tasks with tokio::spawn. Spawned tasks must be Send + 'static, so they cannot borrow local variables. To share data, give each task its own owning handle to it.2 min read#[tokio::main], spawn tasks, and know that a future only makes progress when it is polled. You should also be comfortable with closures and Send + 'static bounds.2 min readtokio::select!, and read a JoinHandle. It explains what happens to a future when it is dropped, and how to write code that survives it.2 min readmpsc channels, and know that select! drops the futures that lose. A clean shutdown means every task gets a chance to finish its current work and release resources before the process exits. Without one, main returning kills all spawned tasks mid-ope2 min read#[tokio::main], tokio::spawn, and the Send and 'static bounds on spawned tasks. It combines async I/O and tasks into one working server.2 min readasync fn and spawn tasks, and that you know how tokio::sleep, timeout and mpsc channels work. It also assumes you can run cargo test.2 min read