Does Async::Barrier
wait for sub-tasks as well?
#373
Answered
by
ioquatix
postmodern
asked this question in
Q&A
-
Does Async::Barrier also wait for any sub-tasks or sub-sub-tasks spawned by the barrier = Async::Barrier.new
concurrency = 10
Async do
concurrency.times do
barrier.async do |task|
# do stuff
task.async do |subtask|
# splinter off and do other stuff
end
# do stuff
end
end
barrier.wait
# all tasks have finished(?)
end |
Beta Was this translation helpful? Give feedback.
Answered by
ioquatix
Feb 7, 2025
Replies: 1 comment
-
No it only waits for tasks that are started using |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
postmodern
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
No it only waits for tasks that are started using
Barrier#async
.