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 1
1
module Concurrent
2
2
module Actress
3
3
4
+ require 'set'
5
+
4
6
# Core of the actor
5
7
# @api private
6
8
class Core
@@ -21,7 +23,7 @@ def initialize(opts = {}, &block)
21
23
# noinspection RubyArgCount
22
24
@terminated = Event . new
23
25
@executor = Type! opts . fetch ( :executor , Concurrent . configuration . global_task_pool ) , Executor
24
- @children = [ ]
26
+ @children = Set . new
25
27
@reference = Reference . new self
26
28
@name = ( Type! opts . fetch ( :name ) , String , Symbol ) . to_s
27
29
@@ -61,13 +63,14 @@ def parent
61
63
# @return [Array<Reference>] of children actors
62
64
def children
63
65
guard!
64
- @children . dup
66
+ @children . to_a
65
67
end
66
68
67
69
# @api private
68
70
def add_child ( child )
69
71
guard!
70
- @children << ( Type! child , Reference )
72
+ Type! child , Reference
73
+ @children . add child
71
74
self
72
75
end
73
76
You can’t perform that action at this time.
0 commit comments