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.
8 9 10 |
# File 'lib/sidekiq/launcher.rb', line 8 def manager @manager end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
8 9 10 |
# File 'lib/sidekiq/launcher.rb', line 8 def @options end |
#poller ⇒ Object (readonly)
Returns the value of attribute poller.
8 9 10 |
# File 'lib/sidekiq/launcher.rb', line 8 def poller @poller end |
Instance Method Details
#procline(tag) ⇒ Object
26 27 28 29 |
# File 'lib/sidekiq/launcher.rb', line 26 def procline(tag) $0 = manager.procline(tag) manager.after(5) { procline(tag) } end |
#run ⇒ Object
15 16 17 18 |
# File 'lib/sidekiq/launcher.rb', line 15 def run manager.async.start poller.async.poll(true) end |
#stop ⇒ Object
20 21 22 23 24 |
# File 'lib/sidekiq/launcher.rb', line 20 def stop poller.async.terminate if poller.alive? manager.async.stop(:shutdown => true, :timeout => [:timeout]) manager.wait(:shutdown) end |