Class Fog::Rackspace::Queues::Mock::MockQueue
In: lib/fog/rackspace/queues.rb
Parent: Object

An in-memory Queue implementation.

Methods

add_claim   add_message   ageoff   claim!   claimed   free   new   newest   oldest   total  

Attributes

claims  [RW] 
messages  [RW] 
metadata  [RW] 
name  [RW] 

Public Class methods

Public Instance methods

Create a new MockClaim.

@param ttl [Integer] Time-to-live for the claim. @param grace [Integer] Grace period that‘s added to messages included in this claim.

Append a new message to the queue.

@param client_id [String] UUID for the service object. @param data [Hash] Message payload. @param ttl [Integer] Number of seconds that the message should exist. @return [MockMessage] The message object that was created.

Remove any messages or claims whose ttls have expired.

Access an existing MockClaim by id.

@param claim_id [String] An ID of an existing claim. @raises [Fog::Rackspace::Queues::NotFound] If no MockClaim with this ID exists. @return [MockClaim] The requested MockClaim.

The number of messages currently held by a claim.

@return [Integer]

The number of messages not held by any claim.

@return [Integer]

The most recently published message on this queue, or `nil`.

@return [MockMessage|UndefinedObject]

The oldest published message on this queue, or `nil`.

@return [MockMessage|UndefinedObject]

The total number of messages currently on the queue.

@return [Integer]

[Validate]