Skip to content

Commit f1471e7

Browse files
committed
Wait for all children to terminate
1 parent 98d1c80 commit f1471e7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/concurrent/actor/behaviour/terminates_children.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ module Behaviour
44
# Terminates all children when the actor terminates.
55
class TerminatesChildren < Abstract
66
def on_event(event)
7-
children.each { |ch| ch << :terminate! } if event == :terminated
7+
children.map { |ch| ch.ask :terminate! }.each(&:wait) if event == :terminated
88
super event
99
end
1010
end

0 commit comments

Comments
 (0)