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.
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 Qpid::Messaging::Duration.new 10000
# File lib/qpid_messaging/duration.rb, line 54 def initialize length @duration_impl = Cqpid::Duration.new length end
Returns the period of time in milliseconds
duration = Qpid::Messaging::Duration.new :length => 5000 puts "Waiting #{duration.milliseconds} ms for a message." msg = receiver.fetch duration
# File lib/qpid_messaging/duration.rb, line 70 def milliseconds @duration_impl.getMilliseconds end