Files
DomFramework/queue.php
2019-05-10 19:21:30 +00:00

80 lines
1.9 KiB
PHP

<?php
/** Manage a queue in multiple storages
* 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
*/
class queue
{
/** The queue connected object
*/
private $queue = null;
/** Connect to the queue
*/
public function connect ($dsn)
{
return $this;
}
/** Add a new entry to the end of the queue
* @param mixed $entry The entry to add
*/
public function add ($entry)
{
return $this;
}
/** Get all the entries of the queue
* @return array
*/
public function getAll ()
{
}
/** Clear all the entries of the queue
*/
public function clear ()
{
return $this;
}
/** 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)
*/
public function getFirst ($delete = false)
{
}
/** 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)
*/
public function getLast ($delete = false)
{
}
/** Get X entries starting at position Y
* @param integer $start the starting position
* @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
*/
public function getRange ($start, $number, $delete = false)
{
}
}