class Concurrent::RubyThreadPoolExecutor

def ns_assign_worker(*args, &task)

Returns:
  • (true, false) - if task is assigned to a worker
def ns_assign_worker(*args, &task)
  # keep growing if the pool is not at the minimum yet
  worker, _ = (@ready.pop if @pool.size >= @min_length) || ns_add_busy_worker
  if worker
    worker << [task, args]
    true
  else
    false
  end
rescue ThreadError
  # Raised when the operating system refuses to create the new thread
  return false
end