1 | <?php |
||
12 | class RabbitMqDriver implements DriverInterface |
||
13 | { |
||
14 | use SerializerAwareTrait; |
||
15 | |||
16 | /** |
||
17 | * @var AMQPChannel |
||
18 | */ |
||
19 | private $channel; |
||
20 | |||
21 | /** |
||
22 | * @var string |
||
23 | */ |
||
24 | private $queue; |
||
25 | |||
26 | /** |
||
27 | * Create new RabbitMqDriver with provided channel. |
||
28 | * |
||
29 | * You have to create connection to rabbit, and setup queue outside of this class. |
||
30 | * Handling connection to rabbit is up to you and you have to manage it. |
||
31 | * |
||
32 | * @see examples/rabbitmq folder |
||
33 | * |
||
34 | * @param AMQPChannel $channel |
||
35 | * @param string $queue |
||
36 | */ |
||
37 | 3 | public function __construct(AMQPChannel $channel, $queue) |
|
43 | |||
44 | /** |
||
45 | * {@inheritdoc} |
||
46 | */ |
||
47 | 3 | public function send(MessageInterface $message) |
|
52 | |||
53 | /** |
||
54 | * {@inheritdoc} |
||
55 | */ |
||
56 | public function wait(Closure $callback) |
||
76 | } |
||
77 |