Polling repeatedly checks asynchronous computations, called futures, for progress or completion. Awaiting each future in sequence works, but polling several futures together lets asynchronous work progress at the same time. section 19.3.4
Common Tokio polling patterns include:
- Use .await sequentially when each result must finish before the next computation starts. section 19.3.4
- Use join! to poll multiple futures together and collect all their results; completion messages may appear in different orders. section 19.3.4
- Use select! to poll several futures and handle whichever finishes first, including a timeout branch. section 19.3.4
- Use try_join! when several Result-producing futures should succeed together or return the first error. section 19.3.4
Polling three delayed computations
Calling three delayed functions with .await prints results in order. Replacing those awaits with join!(wait_and_give_u8(1), wait_and_give_u8(2), wait_and_give_u8(3)) polls them together: the tuple remains (1, 2, 3), while completion messages can arrive in varying orders.








