Add queue and queuefile support

git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@5264 bf3deb0d-5f1a-0410-827f-c0cc1f45334c
This commit is contained in:
2019-05-10 19:21:30 +00:00
parent 3662420339
commit b5ccf521db
2 changed files with 286 additions and 0 deletions

79
queue.php Normal file
View File

@@ -0,0 +1,79 @@
<?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)
{
}
}