Conditions | 2 |
Paths | 2 |
Total Lines | 13 |
Code Lines | 4 |
Lines | 0 |
Ratio | 0 % |
Tests | 5 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
24 | 3 | public function deliver(MessageInterface $message, callable $next): void |
|
25 | { |
||
26 | 3 | if ($message instanceof AsynchronousMessageInterface) { |
|
27 | // By default we 'queue' all QueuedMessage, even if the execute_at is in the past. |
||
28 | // We do this so that we support transactions and can rollback the execution if something goes wrong in |
||
29 | // another part of the transaction. |
||
30 | // If we were to send it to rabbit in the Async middleware, and further on an exception occurs, if would |
||
31 | // already have been processed using rabbit, and there's no way to roll it back. |
||
32 | 1 | $this->messageQueueService->enqueueMessage($message); |
|
33 | 1 | return; |
|
34 | } |
||
35 | |||
36 | 2 | $next($message); |
|
37 | 2 | } |
|
39 |