Class: Processor::Runner
- Inherits:
-
Object
- Object
- Processor::Runner
- Defined in:
- lib/processor/runner.rb
Instance Method Summary collapse
-
#initialize(processor, events_registrator) ⇒ Runner
constructor
A new instance of Runner.
- #run(process_runner) ⇒ Object
Constructor Details
#initialize(processor, events_registrator) ⇒ Runner
Returns a new instance of Runner.
5 6 7 8 |
# File 'lib/processor/runner.rb', line 5 def initialize(processor, events_registrator) @processor = processor @events = events_registrator end |
Instance Method Details
#run(process_runner) ⇒ Object
10 11 12 13 14 15 16 17 18 19 |
# File 'lib/processor/runner.rb', line 10 def run(process_runner) events.register :processing_started, processor process_runner.call processor, events, method(:recursion_preventer) events.register :processing_finished, processor rescue Exception => exception events.register :processing_error, processor, exception raise exception end |