Conditions | 3 |
Paths | 3 |
Total Lines | 13 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
14 | public function enqueue($task) |
||
15 | { |
||
16 | $this->queuedCount++; |
||
17 | |||
18 | $serialized = Formatter::serialize($task); |
||
19 | if ($this->isExceedsLimit($serialized)) { |
||
20 | throw new \RuntimeException('the task exceeds the message queue limit.'); |
||
21 | } |
||
22 | |||
23 | if (!$this->sendMessage($serialized)) { |
||
24 | throw new \RuntimeException('failed to enqueue task.'); |
||
25 | } |
||
26 | } |
||
27 | |||
44 |