try_join_next for JoinSet #6277
Labels
A-tokio
Area: The main tokio crate
C-feature-request
Category: A feature request.
M-task
Module: tokio/task
As pointed out in the discussion in #6157,
JoinSet
appears to be missing a method equivalent totry_recv
onmpsc::Channel
. There ispoll_join_next
, but this appears to be intended for when manually implementing theFuture
trait, as it requires access to aContext
.It is possible to maintain a set of
JoinHandle
, and periodically checkis_finished
on each, where there might be moreJoinHandle
added to the set that is being tracked between checks. However, it feels likeJoinSet
is also intended for this use case, and would be a much more ergonomic abstraction over having to manually do this bookkeeping.The text was updated successfully, but these errors were encountered: