class Concurrent::RubyThreadPoolExecutor
def ns_ready_worker(worker, success = true)
handle ready worker, giving it new job or assigning back to @ready
def ns_ready_worker(worker, success = true) task_and_args = @queue.shift if task_and_args worker << task_and_args else # stop workers when !running?, do not return them to @ready if running? @ready.push(worker) else worker.stop end end end