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
6565 # @param args see {.to_spawn_options}
6666 # @return [Reference] never the actual actor
6767 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
6872 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
7074 else
71- root . ask ( [ :spawn , to_spawn_options ( * args ) , block ] ) . value!
75+ root . ask ( [ :spawn , options , block ] ) . value!
7276 end
7377 end
7478
Original file line number Diff line number Diff line change @@ -172,7 +172,6 @@ def ns_initialize(opts, &block)
172172 allocate_context
173173
174174 @executor = Type! opts . fetch ( :executor , @context . default_executor ) , Concurrent ::AbstractExecutorService
175- raise ArgumentError , 'ImmediateExecutor is not supported' if @executor . is_a? ImmediateExecutor
176175
177176 @reference = ( Child! opts [ :reference_class ] || @context . default_reference_class , Reference ) . new self
178177 @name = ( Type! opts . fetch ( :name ) , String , Symbol ) . to_s
You can’t perform that action at this time.
0 commit comments