class Concurrent::RubyThreadPoolExecutor

def ns_ready_worker(worker, last_message, success = true)

@!visibility private

handle ready worker, giving it new job or assigning back to @ready
def ns_ready_worker(worker, last_message, 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?
      raise unless last_message
      @ready.push([worker, last_message])
    else
      worker.stop
    end
  end
end