Class: Rubyagents::Sandbox::Executor

Inherits:
Object
  • Object
show all
Defined in:
lib/rubyagents/sandbox.rb

Overview


Executor strategy — selected once at load time based on the Ruby engine. Adding a new backend (e.g. TruffleRuby) is a new subclass + one constant.

Direct Known Subclasses

ForkExecutor, ThreadExecutor

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.for_platform ⇒ Object



14
15
16
# File 'lib/rubyagents/sandbox.rb', line 14

def self.for_platform
  RUBY_ENGINE == "jruby" ? ThreadExecutor : ForkExecutor
end

Instance Method Details

#call(_timeout, &_block) ⇒ Object

Raises:

  • (NotImplementedError)


18
19
20
# File 'lib/rubyagents/sandbox.rb', line 18

def call(_timeout, &_block)
  raise NotImplementedError, "#{self.class}#call not implemented"
end