Conditions | 3 |
Paths | 3 |
Total Lines | 13 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
20 | public function __invoke($events) |
||
21 | { |
||
22 | foreach ($events as $event) { |
||
23 | $event_decoded = json_decode($event); |
||
24 | |||
25 | if ($event_decoded->something === 1) { |
||
26 | // IMPORTANT: This exception on multiple events, |
||
27 | // will send all events received by this worker to dead queue. |
||
28 | // Use transactions or bulk inserts when using multiple events |
||
29 | throw new \Exception('Fail, send to dead queue'); |
||
30 | } |
||
31 | |||
32 | dump($event); |
||
33 | } |
||
44 | } |