Class: Pubilion::Worker::Runner
- Inherits:
-
Object
- Object
- Pubilion::Worker::Runner
- Defined in:
- lib/pubilion/worker/runner.rb
Overview
Runner for Pubilion worker
Constant Summary collapse
- WAIT_INTERVAL =
1
- EXIT_SIGNALS =
%w[SIGTERM SIGINT].freeze
Instance Attribute Summary collapse
-
#subscriber ⇒ Object
readonly
Returns the value of attribute subscriber.
Instance Method Summary collapse
-
#initialize(config) ⇒ Runner
constructor
A new instance of Runner.
-
#run ⇒ Object
Start worker and wait for exits.
Constructor Details
#initialize(config) ⇒ Runner
Returns a new instance of Runner.
12 13 14 15 |
# File 'lib/pubilion/worker/runner.rb', line 12 def initialize(config) @handler = Pubilion::Worker::MessageHandler.new @subscriber = Pubilion::Worker::Subscriber.new(config, @handler) end |
Instance Attribute Details
#subscriber ⇒ Object (readonly)
Returns the value of attribute subscriber.
10 11 12 |
# File 'lib/pubilion/worker/runner.rb', line 10 def subscriber @subscriber end |
Instance Method Details
#run ⇒ Object
Start worker and wait for exits.
18 19 20 21 22 23 24 |
# File 'lib/pubilion/worker/runner.rb', line 18 def run subscriber.run wait_for_exits ensure subscriber.shutdown end |