class Concurrent::Async::AsyncDelegator

def perform

called while already running. It will loop until the queue is empty.
This method must be called from within the executor. It must not be

Perform all enqueued tasks.
def perform
  loop do
    ivar, method, args, block = synchronize { @queue.first }
    break unless ivar # queue is empty
    begin
      ivar.set(@delegate.send(method, *args, &block))
    rescue => error
      ivar.fail(error)
    end
    synchronize do
      @queue.shift
      return if @queue.empty?
    end
  end
end