This class allow to add entries in queue and read them later in FIFO or LIFO or global range.
The entries can be anything : string, array, integer...
Internally, the store is done in a file and each entry is recorded in JSON.
Namespace Domframework
/** Manage a queue in file A process can add entries to the end of a queue A process can get all the entries in a queue A process can clear all the entries in a queue A process can get the first entry in the queue (FIFO), with optional removing of the entry A process can get the last entry in the queue (LIFO), with optional removing of the entry A process can get X entries starting at position Y
No property available
/** Add a new entry to the end of the queue@param mixed $entry
The entry to add@return
$this;
/**
Clear all the entries of the queue
@return
$this;
/** Connect to the queue. Create it if not exists@param string $dsn
The DSN to connect to queue@return
$this;
/** Get the number of entries in the queue
/** Get all the entries of the queue@param boolean|null $delete
If true, delete the read entry@return
array
/** Get the first entry in the queue with optional removing of the entry@param boolean|null $delete
If true, delete the read entry@return
mixed Return null if there is no entry, or the first entry in the queue (FIFO)
/** Get the last entry in the queue with optional removing of the entry@param boolean|null $delete
If true, delete the read entry@return
mixed Return null if there is no entry, or the last entry in the queue (LIFO)
/** Get X entries starting at position Y@param integer $start
the starting position (the entries start at position zero)@param integer $number
The number of entries to get@param boolean|null $delete
If true, delete the read entries@return
array An array of mixed entries