Class Qpid::Messaging::Duration
In: lib/qpid_messaging/duration.rb
Parent: Object

A Duration represents a period of time in milliseconds

It defines the following named values as symbols:

:FOREVER
The maximum integer value for the platform. Effectively this will wait forever.
:IMMEDIATE
An alias for 0 milliseconds.
:SECOND
An alias for 1,000 milliseconds.
:MINUTE
And alias for 60,000 millisecons.

Methods

milliseconds   new  

Public Class methods

Creates a Duration with the specified length, in milliseconds.

Options

Examples

  # Wait up to 10 seconds for an incoming message
  receiver.get Qpid::Messaging::Duration.new 10000

Public Instance methods

Returns the period of time in milliseconds

Examples

  duration = Qpid::Messaging::Duration.new :length => 5000
  puts "Waiting #{duration.milliseconds} ms for a message."
  msg = receiver.fetch duration

[Validate]