def work_threads(query=:all)

      ts = threads.select { |t| 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
def work_threads(query=:all)

      ts = threads.select { |t| 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
Lists all the work threads (the ones actually running the scheduled
 block code)

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

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