File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change 11module Concurrent
22 module Actress
33
4+ require 'set'
5+
46 # Core of the actor
57 # @api private
68 class Core
@@ -21,7 +23,7 @@ def initialize(opts = {}, &block)
2123 # noinspection RubyArgCount
2224 @terminated = Event . new
2325 @executor = Type! opts . fetch ( :executor , Concurrent . configuration . global_task_pool ) , Executor
24- @children = [ ]
26+ @children = Set . new
2527 @reference = Reference . new self
2628 @name = ( Type! opts . fetch ( :name ) , String , Symbol ) . to_s
2729
@@ -61,13 +63,14 @@ def parent
6163 # @return [Array<Reference>] of children actors
6264 def children
6365 guard!
64- @children . dup
66+ @children . to_a
6567 end
6668
6769 # @api private
6870 def add_child ( child )
6971 guard!
70- @children << ( Type! child , Reference )
72+ Type! child , Reference
73+ @children . add child
7174 self
7275 end
7376
You can’t perform that action at this time.
0 commit comments