1 | <?php |
||
15 | class LazyRabbitMqDriver implements DriverInterface |
||
16 | { |
||
17 | use MaxItemsTrait; |
||
18 | use RestartTrait; |
||
19 | use SerializerAwareTrait; |
||
20 | |||
21 | /** @var AMQPLazyConnection */ |
||
22 | private $connection; |
||
23 | |||
24 | /** @var AMQPChannel */ |
||
25 | private $channel; |
||
26 | |||
27 | /** @var string */ |
||
28 | private $queue; |
||
29 | |||
30 | /** @var array */ |
||
31 | private $amqpMessageProperties = []; |
||
32 | |||
33 | /** @var integer */ |
||
34 | private $refreshInterval; |
||
35 | |||
36 | /** @var string */ |
||
37 | private $consumerTag; |
||
38 | |||
39 | /** |
||
40 | * @param AMQPLazyConnection $connection |
||
41 | * @param string $queue |
||
42 | * @param array $amqpMessageProperties |
||
43 | * @param int $refreshInterval |
||
44 | * @param string $consumerTag |
||
45 | */ |
||
46 | public function __construct(AMQPLazyConnection $connection, string $queue, array $amqpMessageProperties = [], int $refreshInterval = 0, string $consumerTag = 'hermes') |
||
55 | |||
56 | /** |
||
57 | * {@inheritdoc} |
||
58 | */ |
||
59 | public function send(MessageInterface $message, int $priority = Dispatcher::PRIORITY_MEDIUM): bool |
||
65 | |||
66 | public function setupPriorityQueue(string $name, int $priority): void |
||
70 | |||
71 | /** |
||
72 | * {@inheritdoc} |
||
73 | * @throws RestartException |
||
74 | * @throws \Exception |
||
75 | */ |
||
76 | public function wait(Closure $callback, array $priorities = []): void |
||
107 | |||
108 | private function getChannel(): AMQPChannel |
||
117 | } |
||
118 |