| Conditions | 3 |
| Paths | 3 |
| Total Lines | 12 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 27 | public function pull(int $ttl = 0) |
||
| 28 | { |
||
| 29 | $this->beforePull(); |
||
| 30 | $item = $this->storage->listPop($this->queueKey()); |
||
| 31 | if (!$item) { |
||
| 32 | return $this->emptyQueueBehavior->resolve($this); |
||
| 33 | } else { |
||
| 34 | if ($ttl > 0) { |
||
| 35 | $resumeTime = Carbon::now()->timestamp + $ttl; |
||
| 36 | $this->storage->zSetPush($this->delayedKey(), $resumeTime, $item); |
||
| 37 | } |
||
| 38 | return $this->converter->toPayload($item); |
||
| 39 | } |
||
| 47 |