Class: Postburner::Runner
- Inherits:
-
Object
- Object
- Postburner::Runner
- Defined in:
- lib/postburner/runner.rb
Overview
Shared runner logic for bin/postburner and rake tasks.
Provides a unified interface for starting Postburner workers from both the command-line executable and Rake tasks. Handles configuration loading, queue filtering, logging, and worker startup.
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Runner
constructor
Initialize runner with options.
-
#run ⇒ void
Load configuration, filter queues, and start worker.
Constructor Details
#initialize(options = {}) ⇒ Runner
Initialize runner with options.
35 36 37 38 39 40 41 42 |
# File 'lib/postburner/runner.rb', line 35 def initialize( = {}) @options = { config: 'config/postburner.yml', env: ENV['RAILS_ENV'] || ENV['RACK_ENV'] || 'development', worker: nil, queues: nil }.merge() end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
26 27 28 |
# File 'lib/postburner/runner.rb', line 26 def @options end |
Instance Method Details
#run ⇒ void
This method returns an undefined value.
Load configuration, filter queues, and start worker.
47 48 49 50 51 52 |
# File 'lib/postburner/runner.rb', line 47 def run config = load_configuration filter_queues(config) if [:queues] log_configuration(config) start_worker(config) end |