tokio-rs / tokio

A runtime for writing reliable asynchronous applications with Rust. Provides I/O, networking, scheduling, timers, ...
https://tokio.rs
MIT License
25.44k stars 2.3k forks source link

Doc: JoinSet::try_join_next() returns None when no tasks are completed #6671

Closed teor2345 closed 5 days ago

teor2345 commented 6 days ago

Motivation

The documentation of JoinSet's try_join_next() and try_join_next_with_id() doesn't say what happens if there are no completed tasks.

join_next() waits, but try_join_next() appears to return None immediately.

Solution

Update the docs for both methods.