Class: Stooge::Worker
- Inherits:
-
Object
- Object
- Stooge::Worker
- Defined in:
- lib/stooge/worker.rb
Class Method Summary collapse
-
.run! ⇒ Object
Start the Stooge worker that processes jobs.
-
.run? ⇒ Boolean
Should the Stooge worker be started?.
Class Method Details
.run! ⇒ Object
Start the Stooge worker that processes jobs.
7 8 9 10 11 12 13 14 |
# File 'lib/stooge/worker.rb', line 7 def self.run! Stooge.log "Starting stooge" Signal.trap('INT') { Stooge.stop! } Signal.trap('TERM'){ Stooge.stop! } Stooge.start! end |
.run? ⇒ Boolean
Should the Stooge worker be started?
21 22 23 24 |
# File 'lib/stooge/worker.rb', line 21 def self.run? Stooge.has_handlers? && File.($0) == File.(app_file) end |