Class: Airflow::Runner::BaseRunner
- Inherits:
-
Object
- Object
- Airflow::Runner::BaseRunner
- Includes:
- Utils::Logger
- Defined in:
- lib/async_flow/runner.rb
Direct Known Subclasses
Instance Method Summary collapse
-
#initialize(definitions) ⇒ BaseRunner
constructor
A new instance of BaseRunner.
-
#run(reactor) ⇒ Object
should already run parallel with the main worker.
- #stop ⇒ Object
Methods included from Utils::Logger
Constructor Details
#initialize(definitions) ⇒ BaseRunner
Returns a new instance of BaseRunner.
31 32 33 34 35 36 |
# File 'lib/async_flow/runner.rb', line 31 def initialize(definitions) @poller = Poller.new(Persistence.workflow_runs) @executor = Executors::ThreadPoolExecutor.new(1) @definitions = definitions @mutex = Mutex.new end |
Instance Method Details
#run(reactor) ⇒ Object
should already run parallel with the main worker
39 40 41 42 43 |
# File 'lib/async_flow/runner.rb', line 39 def run(reactor) logger.info "starting runner #{self}" running! _loop(reactor) end |
#stop ⇒ Object
45 46 47 48 49 |
# File 'lib/async_flow/runner.rb', line 45 def stop executor&.shutdown @running = false # TODO: Investigate why putting this on top does not stop the runner logger.info "runner #{self} stopped" end |