git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@6095 bf3deb0d-5f1a-0410-827f-c0cc1f45334c
90 lines
2.2 KiB
PHP
90 lines
2.2 KiB
PHP
<?php
|
|
/** DomFramework
|
|
* @package domframework
|
|
* @author Dominique Fournier <dominique@fournier38.fr>
|
|
*/
|
|
|
|
/** 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
|
|
* @param string $dsn The DSN to connect to queue
|
|
* @return $this;
|
|
*/
|
|
public function connect ($dsn)
|
|
{
|
|
return $this;
|
|
}
|
|
|
|
/** Add a new entry to the end of the queue
|
|
* @param mixed $entry The entry to add
|
|
* @return $this;
|
|
*/
|
|
public function add ($entry)
|
|
{
|
|
return $this;
|
|
}
|
|
|
|
/** Get all the entries of the queue
|
|
* @return array
|
|
*/
|
|
public function getAll ()
|
|
{
|
|
}
|
|
|
|
/** Get the number of entries in the queue
|
|
*/
|
|
public function count ()
|
|
{
|
|
}
|
|
|
|
/** Clear all the entries of the queue
|
|
* @return $this;
|
|
*/
|
|
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)
|
|
{
|
|
}
|
|
}
|