Class: Sidekiq::Launcher
- Inherits:
-
Object
- Object
- Sidekiq::Launcher
- Defined in:
- lib/sidekiq/launcher.rb
Instance Attribute Summary collapse
-
#manager ⇒ Object
readonly
Returns the value of attribute manager.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#poller ⇒ Object
readonly
Returns the value of attribute poller.
Instance Method Summary collapse
-
#initialize(options) ⇒ Launcher
constructor
A new instance of Launcher.
- #procline(tag) ⇒ Object
- #run ⇒ Object
- #stop ⇒ Object
Constructor Details
Instance Attribute Details
#manager ⇒ Object (readonly)
Returns the value of attribute manager.
7 8 9 |
# File 'lib/sidekiq/launcher.rb', line 7 def manager @manager end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
7 8 9 |
# File 'lib/sidekiq/launcher.rb', line 7 def @options end |
#poller ⇒ Object (readonly)
Returns the value of attribute poller.
7 8 9 |
# File 'lib/sidekiq/launcher.rb', line 7 def poller @poller end |
Instance Method Details
#procline(tag) ⇒ Object
25 26 27 28 |
# File 'lib/sidekiq/launcher.rb', line 25 def procline(tag) $0 = manager.procline(tag) manager.after(5) { procline(tag) } end |
#run ⇒ Object
14 15 16 17 |
# File 'lib/sidekiq/launcher.rb', line 14 def run manager.async.start poller.async.poll(true) end |
#stop ⇒ Object
19 20 21 22 23 |
# File 'lib/sidekiq/launcher.rb', line 19 def stop poller.async.terminate if poller.alive? manager.async.stop(:shutdown => true, :timeout => [:timeout]) manager.wait(:shutdown) end |