class Rufus::Scheduler

def work_threads(query=:all)


:all.
main scheduler thread, that thread will get returned when :active or
If, thanks to :blocking => true, a job is scheduled to monopolize the

* :vacant, returns the threads that are not running a job
* :active, returns all threads that are currenly running a job
or are currently running a job
* :all (default), returns all the threads that are work threads
Accepts a query option, which can be set to:

block code)
Lists all the work threads (the ones actually running the scheduled
def work_threads(query=:all)
  ts =
    threads.select { |t|
      t[:rufus_scheduler_job] || t[:rufus_scheduler_work_thread]
    }
  case query
    when :active then ts.select { |t| t[:rufus_scheduler_job] }
    when :vacant then ts.reject { |t| t[:rufus_scheduler_job] }
    else ts
  end
end