| 1 | <?php |
||
| 7 | class ExchangeDeclarer |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * @var array |
||
| 11 | */ |
||
| 12 | private $declaredExchanges = []; |
||
| 13 | |||
| 14 | /** |
||
| 15 | * @var Connection |
||
| 16 | */ |
||
| 17 | private $connection; |
||
| 18 | |||
| 19 | /** |
||
| 20 | * @var ChannelInterface |
||
| 21 | */ |
||
| 22 | private $channel; |
||
| 23 | |||
| 24 | 1 | public function __construct(Connection $connection, string $channelId = '') |
|
| 29 | |||
| 30 | /* |
||
| 31 | * This method will be run each time we attempt to queue a message. |
||
| 32 | * We will cache locally which exchanges we have already declared. |
||
| 33 | * Declaring an exchange on each iteration of a worker consuming from |
||
| 34 | * a queue is really slow. |
||
| 35 | */ |
||
| 36 | 1 | public function declareExchange(Exchange $exchange) |
|
| 43 | } |
||
| 44 |