Storage
2 years ago
FileSeekableQueue.php
2 years ago
FinishedQueueException.php
5 years ago
Queue.php
2 years ago
QueueInterface.php
4 years ago
SeekableQueueInterface.php
4 years ago
QueueInterface.php
79 lines
| 1 | <?php |
| 2 | |
| 3 | // TODO PHP7.x; declare(strict_types=1); |
| 4 | // TODO PHP7.x; return types && type-hints |
| 5 | |
| 6 | namespace WPStaging\Framework\Queue; |
| 7 | |
| 8 | use WPStaging\Framework\Queue\Storage\StorageInterface; |
| 9 | |
| 10 | interface QueueInterface |
| 11 | { |
| 12 | /** |
| 13 | * @param string $name |
| 14 | * |
| 15 | * @return void |
| 16 | */ |
| 17 | public function setName($name); |
| 18 | |
| 19 | /** |
| 20 | * @return string |
| 21 | */ |
| 22 | public function getName(); |
| 23 | |
| 24 | /** |
| 25 | * @param StorageInterface $storage |
| 26 | * |
| 27 | * @return self |
| 28 | */ |
| 29 | public function setStorage(StorageInterface $storage); |
| 30 | |
| 31 | /** |
| 32 | * @return StorageInterface |
| 33 | */ |
| 34 | public function getStorage(); |
| 35 | |
| 36 | /** |
| 37 | * Count all items in the queue |
| 38 | * |
| 39 | * @return int |
| 40 | */ |
| 41 | public function count(); |
| 42 | |
| 43 | /** |
| 44 | * Remove and get the first element from the queue |
| 45 | * @return mixed |
| 46 | */ |
| 47 | public function pop(); |
| 48 | |
| 49 | /** |
| 50 | * Append item to the end of the queue |
| 51 | * |
| 52 | * @param mixed $value |
| 53 | */ |
| 54 | public function push($value); |
| 55 | |
| 56 | /** |
| 57 | * Push array of items to the end of the queue |
| 58 | * @param array $value |
| 59 | */ |
| 60 | public function pushAsArray(array $value = []); |
| 61 | |
| 62 | /** |
| 63 | * Add item to the beginning of the queue |
| 64 | * |
| 65 | * @param mixed $value |
| 66 | */ |
| 67 | public function prepend($value); |
| 68 | |
| 69 | /** |
| 70 | * Removes all the items from the queue |
| 71 | */ |
| 72 | public function reset(); |
| 73 | |
| 74 | /** |
| 75 | * Save items in the queue |
| 76 | */ |
| 77 | public function save(); |
| 78 | } |
| 79 |