Join!
join! is an asynchronous macro that concurrently drives multiple futures and completes when all of them have completed.
Rust Servers, Services, and Apps
The Rust join macro drives multiple asynchronous computations and completes after all of them complete.
- How it is used
- Coordinates multiple Tokio tasks in an asynchronous program and delays continuation until all tasks finish.
- How deep it goes
- Explains completion, lazy async functions, awaiting, spawning, and scheduling, but does not develop macro internals.
- Examples
- Uses two simulated file-reading tasks whose four-second and two-second delays produce observable completion ordering.
- What you can do after
- Apply it via Tokio to wait for multiple spawned asynchronous operations in an async main function.
Learn Rust in a Month of Lunches
join! is an asynchronous macro that concurrently drives multiple futures and completes when all of them complete.
- How it is used
- Runs independent futures concurrently when asynchronous code should make progress together rather than await each operation sequentially.
- How deep it goes
- Defines concurrent polling through a runnable example, but stops short of explaining the macro's implementation internals.
- Examples
- Demonstrates three randomly delayed numeric futures whose print order varies while their tuple result stays ordered.
- What you can do after
- Apply concurrent future polling with Tokio's join! macro and recognize its ordered tuple result.
Related concepts
- concurrencyused by · Concurrency is the structuring or execution of multiple computational activities so their progress overlaps in time, whether or not they run simultaneously.
- futureuses · A future is an abstraction representing an asynchronous computation or its result, which may not be complete or available yet.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.

