1 | <?php |
||
20 | class RabbitMqDriver implements DriverInterface |
||
21 | { |
||
22 | use SerializerAwareTrait; |
||
23 | |||
24 | /** |
||
25 | * @var AMQPChannel |
||
26 | */ |
||
27 | private $channel; |
||
28 | |||
29 | /** |
||
30 | * @var string |
||
31 | */ |
||
32 | private $queue; |
||
33 | |||
34 | /** |
||
35 | * @var array |
||
36 | */ |
||
37 | 3 | private $amqpMessageProperties = []; |
|
38 | |||
39 | 3 | /** |
|
40 | 3 | * Create new RabbitMqDriver with provided channel. |
|
41 | 3 | * |
|
42 | 3 | * You have to create connection to rabbit, and setup queue outside of this class. |
|
43 | * Handling connection to rabbit is up to you and you have to manage it. |
||
44 | * |
||
45 | * @see examples/rabbitmq folder |
||
46 | * |
||
47 | 3 | * @param AMQPChannel $channel |
|
48 | * @param string $queue |
||
49 | 3 | * @param array $amqpMessageProperties |
|
50 | 3 | */ |
|
51 | 3 | public function __construct(AMQPChannel $channel, string $queue, array $amqpMessageProperties = []) |
|
58 | |||
59 | /** |
||
60 | * {@inheritdoc} |
||
61 | */ |
||
62 | public function send(MessageInterface $message, int $priority = Dispatcher::PRIORITY_MEDIUM): bool |
||
68 | |||
69 | public function setupPriorityQueue(string $name, int $priority): void |
||
73 | |||
74 | /** |
||
75 | * {@inheritdoc} |
||
76 | */ |
||
77 | public function wait(Closure $callback, array $priorities): void |
||
97 | } |
||
98 |