| 1 | <?php |
||
| 5 | class PrefetchMessageCache |
||
| 6 | { |
||
| 7 | protected $caches = []; |
||
| 8 | |||
| 9 | /** |
||
| 10 | * Pushes a $message to the end of the cache. |
||
| 11 | * |
||
| 12 | * @param string $queueName |
||
| 13 | * @param array $message |
||
| 14 | */ |
||
| 15 | 5 | public function push($queueName, array $message) |
|
| 20 | |||
| 21 | /** |
||
| 22 | * Get the next message in line. Or nothing if there is no more |
||
| 23 | * in the cache. |
||
| 24 | * |
||
| 25 | * @param string $queueName |
||
| 26 | * |
||
| 27 | * @return array|null |
||
| 28 | */ |
||
| 29 | 6 | public function pop($queueName) |
|
| 37 | |||
| 38 | /** |
||
| 39 | * Create the queue cache internally if it doesn't yet exists. |
||
| 40 | * |
||
| 41 | * @param string $queueName |
||
| 42 | * |
||
| 43 | * @return \SplQueue |
||
| 44 | */ |
||
| 45 | 6 | protected function get($queueName) |
|
| 53 | } |
||
| 54 |