Class: Hive::Scheduler
Instance Attribute Summary
Attributes inherited from Worker
Instance Method Summary collapse
Methods inherited from Worker
#daemonize, #initialize, instance, #restart, run, #set_traps, #start, #start_console, #start_debugger, #start_drb, #start_logger, #stop
Constructor Details
This class inherits a constructor from Hive::Worker
Instance Method Details
#stop_tasks ⇒ Object
10 11 12 13 14 15 16 17 18 |
# File 'lib/hive/scheduler.rb', line 10 def stop_tasks threads = Thread.list.select { |t| t.alive? && t != Thread.current } until threads.empty? logger.info "#{threads.size} threads still running ... " threads.each { |t| t.kill && t != Thread.current } threads = threads.select { |t| t.alive? } end logger.info "All threads are finished." end |