Method: Qpid::Proton::WorkQueue#schedule

Defined in:
lib/core/work_queue.rb

#schedule(at) {|| ... } ⇒ void

Note:

Thread Safe: may be called in any thread.

This method returns an undefined value.

Schedule a block to be invoked at a certain time.

Parameters:

  • Invoke block as soon as possible after Time at

  • Invoke block after a delay of at seconds from now

Yields:

  • ()

    (see #add)

Raises:

  • if the queue is closed and cannot accept more work

API:

  • qpid



61
62
63
64
65
66
67
68
# File 'lib/core/work_queue.rb', line 61

def schedule(at, &block)
  raise ArgumentError, "no block" unless block_given?
  @lock.synchronize do
    raise @closed if @closed
    @schedule.insert(at, block)
  end
  @container.send :wake
end