@@ 438-456 (lines=19) @@ | ||
435 | * @throws \InvalidArgumentException |
|
436 | * @throws \PHPDaemon\Clients\AMQP\Driver\Protocol\Exception\AMQPProtocolException |
|
437 | */ |
|
438 | public function bindQueue($name, $exchangeName, $routingKey, array $options = [], callable $callback = null) |
|
439 | { |
|
440 | $noWait = array_key_exists('noWait', $options) ? (bool)$options['noWait'] : null; |
|
441 | $arguments = array_key_exists('arguments', $options) ? $options['arguments'] : null; |
|
442 | ||
443 | $outputFrame = Queue\QueueBindFrame::create( |
|
444 | $name, |
|
445 | $exchangeName, |
|
446 | $routingKey, |
|
447 | $noWait, |
|
448 | $arguments |
|
449 | ); |
|
450 | $outputFrame->frameChannelId = $this->id; |
|
451 | $this->connection->command($outputFrame); |
|
452 | ||
453 | if (is_callable($callback)) { |
|
454 | $this->on(self::EVENT_ON_CHANNEL_BIND_QUEUE_CALLBACK, $callback); |
|
455 | } |
|
456 | } |
|
457 | ||
458 | /** |
|
459 | * Unbind queue from exchange |
|
@@ 529-541 (lines=13) @@ | ||
526 | * @throws \InvalidArgumentException |
|
527 | * @throws \PHPDaemon\Clients\AMQP\Driver\Protocol\Exception\AMQPProtocolException |
|
528 | */ |
|
529 | public function deleteExchange($name, array $options = [], callable $callback = null) |
|
530 | { |
|
531 | $ifUnused = array_key_exists('ifUnused', $options) ? (bool)$options['ifUnused'] : null; |
|
532 | $noWait = array_key_exists('noWait', $options) ? (bool)$options['noWait'] : null; |
|
533 | ||
534 | $outputFrame = Exchange\ExchangeDeleteFrame::create($name, $ifUnused, $noWait); |
|
535 | $outputFrame->frameChannelId = $this->id; |
|
536 | $this->connection->command($outputFrame); |
|
537 | ||
538 | if (is_callable($callback)) { |
|
539 | $this->on(self::EVENT_ON_CHANNEL_DELETE_EXCHANGE_CALLBACK, $callback); |
|
540 | } |
|
541 | } |
|
542 | ||
543 | /** |
|
544 | * Bind exchange |