1 | <?php |
||
8 | class QueueDeclarer |
||
9 | { |
||
10 | /** |
||
11 | * @var array |
||
12 | */ |
||
13 | private $declaredQueues = []; |
||
14 | |||
15 | /** |
||
16 | * @var Connection |
||
17 | */ |
||
18 | private $connection; |
||
19 | |||
20 | /** |
||
21 | * @var QueueConfig |
||
22 | */ |
||
23 | private $config; |
||
24 | |||
25 | /** |
||
26 | * @var ChannelInterface |
||
27 | */ |
||
28 | private $channel; |
||
29 | |||
30 | 2 | public function __construct(Connection $connection, QueueConfig $config, string $channelId = '') |
|
36 | |||
37 | /* |
||
38 | * This method will be run each time we attempt to queue a message. |
||
39 | * We will cache locally which queues we have already declared. |
||
40 | * Declaring a queue on each iteration of a worker consuming from |
||
41 | * a queue is really slow. |
||
42 | */ |
||
43 | 2 | public function declareQueue($queueName) |
|
66 | } |
||
67 |