File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -65,10 +65,14 @@ def self.root
65
65
# @param args see {.to_spawn_options}
66
66
# @return [Reference] never the actual actor
67
67
def self . spawn ( *args , &block )
68
+ options = to_spawn_options ( *args )
69
+ if options [ :executor ] && options [ :executor ] . is_a? ( ImmediateExecutor )
70
+ raise ArgumentError , 'ImmediateExecutor is not supported'
71
+ end
68
72
if Actor . current
69
- Core . new ( to_spawn_options ( * args ) . merge ( parent : Actor . current ) , &block ) . reference
73
+ Core . new ( options . merge ( parent : Actor . current ) , &block ) . reference
70
74
else
71
- root . ask ( [ :spawn , to_spawn_options ( * args ) , block ] ) . value!
75
+ root . ask ( [ :spawn , options , block ] ) . value!
72
76
end
73
77
end
74
78
Original file line number Diff line number Diff line change @@ -172,7 +172,6 @@ def ns_initialize(opts, &block)
172
172
allocate_context
173
173
174
174
@executor = Type! opts . fetch ( :executor , @context . default_executor ) , Concurrent ::AbstractExecutorService
175
- raise ArgumentError , 'ImmediateExecutor is not supported' if @executor . is_a? ImmediateExecutor
176
175
177
176
@reference = ( Child! opts [ :reference_class ] || @context . default_reference_class , Reference ) . new self
178
177
@name = ( Type! opts . fetch ( :name ) , String , Symbol ) . to_s
You can’t perform that action at this time.
0 commit comments