osrf-devel:persist-queue
Table of Contents
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.
- Parameters:
- slot_name
The name of the Persistence Slot to use for storing the object. - object
The object that should be pushed onto the front of the QUEUE.
- Returns:
- Success
The name of the Slot that was used. - Failure
An empty (NULL) result.
opensrf.persist.queue.pop( slot_name )
Removes and returns the next value in a QUEUE type Slot.
- Parameters:
- slot_name
The name of the Persistence Slot from which an object should be retrieved.
- 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:
- slot_name
The name of the Persistence Slot from which an object should be retrieved.
- 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:
- slot_name
The name of the Persistence Slot from which the objects should be retrieved.
- 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:
- slot_name
The name of the Persistence Slot from which the objects should be retrieved.
- 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.
- Parameters:
- slot_name
The name of the Persistence Slot in question.
- Returns:
- Success
The number of objects in the Persistence Slot. - Failure
An empty (NULL) result.
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:
- slot_name
The name of the Persistence Slot in question.
- Returns:
- Success
The space, in bytes, used by the JSON encoded objects in the Persistence Slot. - Failure
An empty (NULL) result.
osrf-devel/persist-queue.txt · Last modified: 2022/02/10 13:34 by 127.0.0.1