Class: Bluth::CLI
- Inherits:
-
Drydock::Command
- Object
- Drydock::Command
- Bluth::CLI
- Defined in:
- lib/bluth/cli.rb
Instance Method Summary collapse
- #schedulers ⇒ Object
- #start_scheduler ⇒ Object
-
#start_worker(worker_class = Bluth::Worker) ⇒ Object
def flush_workers if @global.auto || Annoy.are_you_sure? Bluth::Worker.prefix end end.
- #start_workers ⇒ Object
- #stop_scheduler ⇒ Object
- #stop_worker(wid = nil, worker_class = Bluth::Worker) ⇒ Object
- #stop_workers(worker_class = Bluth::Worker) ⇒ Object
- #workers(worker_class = Bluth::Worker) ⇒ Object
Instance Method Details
#schedulers ⇒ Object
19 20 21 |
# File 'lib/bluth/cli.rb', line 19 def schedulers workers Bluth.scheduler end |
#start_scheduler ⇒ Object
11 12 13 |
# File 'lib/bluth/cli.rb', line 11 def start_scheduler start_worker Bluth.scheduler end |
#start_worker(worker_class = Bluth::Worker) ⇒ Object
29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/bluth/cli.rb', line 29 def start_worker worker_class=Bluth::Worker if @global.daemon worker = worker_class.new Familia.info "Created: #{worker.rediskey}" worker.daemonize worker.run else Bluth.queuetimeout = 3.seconds worker_class.run end end |
#start_workers ⇒ Object
7 8 9 |
# File 'lib/bluth/cli.rb', line 7 def start_workers start_worker end |
#stop_scheduler ⇒ Object
15 16 17 |
# File 'lib/bluth/cli.rb', line 15 def stop_scheduler stop_workers Bluth.scheduler end |
#stop_worker(wid = nil, worker_class = Bluth::Worker) ⇒ Object
48 49 50 51 52 53 54 55 |
# File 'lib/bluth/cli.rb', line 48 def stop_worker wid=nil,worker_class=Bluth::Worker wids = wid ? [wid] : @argv Bluth.connect wids.each do |wid| worker = worker_class.from_redis wid kill_worker worker, worker_class end end |
#stop_workers(worker_class = Bluth::Worker) ⇒ Object
41 42 43 44 45 46 |
# File 'lib/bluth/cli.rb', line 41 def stop_workers worker_class=Bluth::Worker Bluth.connect worker_class.instances.each do |worker| kill_worker worker, worker_class end end |
#workers(worker_class = Bluth::Worker) ⇒ Object
57 58 59 |
# File 'lib/bluth/cli.rb', line 57 def workers worker_class=Bluth::Worker Familia.info worker_class.all.collect &:key end |