Method: Async::Barrier#wait

Defined in:
lib/async/barrier.rb

#waitObject

Wait for all tasks to complete by invoking Task#wait on each waiting task, which may raise an error. As long as the task has completed, it will be removed from the barrier.


59
60
61
62
63
64
65
66
67
68
# File 'lib/async/barrier.rb', line 59

def wait
	@tasks.each do |waiting|
		task = waiting.task
		begin
			task.wait
		ensure
			@tasks.remove?(waiting) unless task.alive?
		end
	end
end