flâneur — a map of the web's best reading

Fundamentals of Asynchronous Programming: Async, Await, Futures, and Streams - The Rust Programming Language

doc.rust-lang.org · 1,509 words · saved by 1 readers

Many operations we ask the computer to do can take a while to finish. It would be nice if we could do something else while we are waiting for those long-running processes to complete. Modern computers offer two techniques for working on more than one operation at a time: parallelism and concurrency. Once we start writing programs that involve parallel or concurrent operations, though, we quickly encounter new challenges inherent to asynchronous programming, where operations may not finish sequentially in the order they were started. This chapter builds on Chapter 16’s use of threads for parallelism and concurrency by introducing an alternative approach to asynchronous programming: Rust’s Futures, Streams, the async and await syntax that supports them, and the tools for managing and coordinating between asynchronous operations. Let’s consider an example. Say you’re exporting a video you’ve created of a family celebration, an operation that could take anywhere from minutes to hours. The

Fundamentals of Asynchronous Programming: Async, Await, Futures, and Streams - The Rust Programming Language Keyboard shortcuts Press ← or → to navigate between chapters Press S or / to search in the book Press ? to show this help Press Esc to hide this help Auto Light Rust Coal Navy Ayu The Rust Programming Language Fundamentals of Asynchronous Programming: Async, Await, Futures, and Streams Many operations we ask the computer to do can take a while to finish. It would be nice if we could do something else while we’re waiting for those long-running processes to complete. Modern computers offe

Explore this link on the map →

related reading