User Comments
QUEUE API-Namespace Slot methods
Uses the Slot in FIFO mode, pushing values onto one end an pulling them off the other. The QUEUE API-Namespace is useful for creating an ordered message passing access point.
opensrf.persist.queue.push( slot_name, object )
Adds an object to a Slot in FIFO order.
opensrf.persist.queue.pop( slot_name )
Removes and returns the next value in a QUEUE type Slot.
Parameters:
Returns:
Success
The next object on the QUEUE Slot, or an empty (NULL) result if the Slot is empty.
Failure
An empty (NULL) result.
opensrf.persist.queue.peek( slot_name )
Returns the next value in a QUEUE type Slot without removing it.
Parameters:
Returns:
Success
The next object on the QUEUE Slot, or an empty (NULL) result if the Slot is empty.
Failure
An empty (NULL) result.
opensrf.persist.queue.peek.all( slot_name )
Returns all values in a QUEUE type Slot without removing them.
Parameters:
Returns:
Success
A stream of all objects on the QUEUE Slot, or an empty (NULL) result if the Slot is empty.
Failure
An empty (NULL) result.
opensrf.persist.queue.peek.all.atomic( slot_name )
Returns all values in a QUEUE type Slot without removing them.
Parameters:
Returns:
Success
A single array of all objects on the QUEUE Slot, or an empty array if the Slot is empty.
Failure
An empty (NULL) result.
opensrf.persist.queue.length( slot_name )
Returns the number of objects in the QUEUE type Slot.
opensrf.persist.queue.size( slot_name )
Returns the number bytes taken up by the JSON encoded version of the objects in the QUEUE type Slot.
Parameters:
Returns:
Success
The space, in bytes, used by the JSON encoded objects in the Persistence Slot.
Failure
An empty (NULL) result.