Ability to split a JoinSet into spawn and join halves #6547
Labels
A-tokio
Area: The main tokio crate
C-feature-request
Category: A feature request.
M-task
Module: tokio/task
Is your feature request related to a problem? Please describe.
JoinSet requires a mutable reference to spawn or join tasks. This means you cannot have 2 concurrent tasks appending tasks and joining them.
This may be required for example when you have to spawn multiple millions of tasks so you use a semaphore and acquire a ticket before you spawn a new task.
Describe the solution you'd like
A simple
fn split(self) -> (SpawnerHalf, JoinerHalf)
method like this:Describe alternatives you've considered
join_next()
.The text was updated successfully, but these errors were encountered: