Class: Rabbithole::CLI
- Inherits:
-
Thor
- Object
- Thor
- Rabbithole::CLI
- Defined in:
- lib/rabbithole/cli.rb
Instance Method Summary collapse
Instance Method Details
#work ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/rabbithole/cli.rb', line 9 def work load_environment [:require] @worker = Worker.new([:num_workers]) queues = [:queues] queues << Rabbithole::Connection::DEFAULT_QUEUE if queues.delete('default') || queues.delete('*') queues.each do |queue| @worker.listen_to_queue(queue) end Signal.trap("INT") { shutdown } @worker.join end |