Class: Sisyphus::ForkingExecutionStrategy
- Inherits:
-
Object
- Object
- Sisyphus::ForkingExecutionStrategy
- Defined in:
- lib/sisyphus/forking_execution_strategy.rb
Defined Under Namespace
Classes: ChildProcess
Instance Attribute Summary collapse
-
#logger ⇒ Object
readonly
Returns the value of attribute logger.
Instance Method Summary collapse
- #execute(job, error_handler = ->{}) ⇒ Object
-
#initialize(logger) ⇒ ForkingExecutionStrategy
constructor
A new instance of ForkingExecutionStrategy.
Constructor Details
#initialize(logger) ⇒ ForkingExecutionStrategy
Returns a new instance of ForkingExecutionStrategy.
6 7 8 |
# File 'lib/sisyphus/forking_execution_strategy.rb', line 6 def initialize(logger) @logger = logger end |
Instance Attribute Details
#logger ⇒ Object (readonly)
Returns the value of attribute logger.
4 5 6 |
# File 'lib/sisyphus/forking_execution_strategy.rb', line 4 def logger @logger end |
Instance Method Details
#execute(job, error_handler = ->{}) ⇒ Object
10 11 12 13 14 15 16 |
# File 'lib/sisyphus/forking_execution_strategy.rb', line 10 def execute(job, error_handler = ->{}) if @child_pid = fork error_handler.call unless success? else perform job end end |