Total Complexity | 7 |
Total Lines | 71 |
Duplicated Lines | 0 % |
Coverage | 83.33% |
Changes | 0 |
1 | <?php |
||
17 | class RabbitMQFacade extends AbstractFacade implements RabbitMQFacadeInterface |
||
18 | { |
||
19 | /** |
||
20 | * Initiate the exchanges and queues in RabbitMQ |
||
21 | * |
||
22 | * @api |
||
23 | */ |
||
24 | 2 | public function init(): void |
|
25 | { |
||
26 | $this |
||
27 | 2 | ->getFactory() |
|
28 | 2 | ->createBootstrapper() |
|
29 | 2 | ->boot(); |
|
30 | 2 | } |
|
31 | |||
32 | /** |
||
33 | * @param \Xervice\RabbitMQ\Business\Dependency\Worker\Listener\ListenerInterface $listener |
||
34 | */ |
||
35 | 2 | public function consumeQueries(ListenerInterface $listener): void |
|
36 | { |
||
37 | 2 | $this->getFactory() |
|
38 | 2 | ->createConsumer($listener) |
|
39 | 2 | ->consumeQueries(); |
|
40 | 2 | } |
|
41 | |||
42 | 2 | public function runWorker(OutputInterface $output = null): void |
|
48 | 2 | } |
|
49 | |||
50 | 1 | public function reconnect(): void |
|
57 | 1 | } |
|
58 | |||
59 | public function close(): void |
||
60 | { |
||
61 | $this |
||
62 | ->getFactory() |
||
63 | ->getConnectionProvider() |
||
64 | ->getConnection() |
||
65 | ->close(); |
||
66 | } |
||
67 | |||
68 | /** |
||
69 | * @param \DataProvider\RabbitMqMessageDataProvider $messageDataProvider |
||
70 | */ |
||
71 | 1 | public function sendMessage(RabbitMqMessageDataProvider $messageDataProvider): void |
|
72 | { |
||
73 | $this |
||
74 | 1 | ->getFactory() |
|
75 | 1 | ->getMessageProvider() |
|
76 | 1 | ->sendMessage($messageDataProvider); |
|
77 | 1 | } |
|
78 | |||
79 | /** |
||
80 | * @param \DataProvider\RabbitMqMessageCollectionDataProvider $messageCollectionDataProvider |
||
81 | */ |
||
82 | 1 | public function sendMessages(RabbitMqMessageCollectionDataProvider $messageCollectionDataProvider): void |
|
88 | 1 | } |
|
89 | } |
||
90 |