class Qpid::Messaging::Duration

A Duration represents a period of time in milliseconds

It defines the following named values as symbols:


The maximum integer value for the platform. Effectively this will wait forever.


An alias for 0 milliseconds.


An alias for 1,000 milliseconds.


And alias for 60,000 millisecons.

Public Class Methods

new(length) click to toggle source

Creates a Duration with the specified length, in milliseconds.


  • length - The duration in milliseconds.


# Wait up to 10 seconds for an incoming message
receiver.get 10000
# File qpid/ruby/lib/qpid_messaging/duration.rb, line 54
def initialize length
  @duration_impl = length

Public Instance Methods

milliseconds() click to toggle source

Returns the period of time in milliseconds


duration = :length => 5000
puts "Waiting #{duration.milliseconds} ms for a message."
msg = receiver.fetch duration
# File qpid/ruby/lib/qpid_messaging/duration.rb, line 70
def milliseconds