Skip to content

Commit 7b7b3e2

Browse files
author
Petr Chalupa
committed
Merge pull request #141 from ruby-concurrency/actress
Wait for all children to terminate
2 parents 98d1c80 + f1471e7 commit 7b7b3e2

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)