module Concurrent::Executor

def post(*args, &task)

Raises:
  • (ArgumentError) - if no task is given

Returns:
  • (Boolean) - `true` if the task is queued, `false` if the executor

Other tags:
    Yield: - the asynchronous task to perform

Parameters:
  • args (Array) -- zero or more arguments to be passed to the task
def post(*args, &task)
  raise ArgumentError.new('no block given') unless block_given?
  mutex.synchronize do
    return false unless running?
    execute(*args, &task)
    true
  end
end