-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add is_finished
functionality to JoinSet
#5609
Comments
From your motivation, it sounds like you want to wait for them to finish, rather than just check whether they are currently finished? |
Well, I potentially want to have multiple of these groups running in the the same, and some handler that starts them (that doesn't wait for any one to finish, but can perform an action is any is completed). I guess I could start a single "task" for each "group," then in that "task" wait for the JoinSet to all complete. Would that be the advised approach? I might be convinced that an approach like that is more semantic. |
I have a similar need for shotman. In my main loop, I want to check if all tasks of a |
Maybe the upcoming #6033 is better for that use-case? Implementing this for |
Indeed, it seems like |
I'm going to close this because it isn't trivial to implement efficiently. I think people should probably use a |
Is your feature request related to a problem? Please describe.
I would like to pass around a JoinSet to capture a group of Tasks that all belong to a similar larger order "task" I am trying to accomplish. Once an entire group is done, I want to perform some action to inform a user the group is done.
EDIT: I also want to be able to abort the group of tasks (all of them) if some action is taken by a user. This is very important. Say I have the higher-order task A, which has two tasks spawned within it. Aborting task A does not kill the two tasks spawned within. This is how I landed on the need to use a vector or a JoinSet to keep track of all the tasks at the same level.
Describe the solution you'd like
A
is_finished
orare_finished
method on the JoinSetSomething as simple as (I think would work:
Describe alternatives you've considered
I've considered making a vector or JoinHandles - which is very simple - but is this not the purpose of a JoinSet?
Additional context
I am happy to PR here -- but wanted to hear from the community if this is even the right approach (I have never contributed to OpenSource before)
The text was updated successfully, but these errors were encountered: