@@ 414-425 (lines=12) @@ | ||
411 | * @throws \InvalidArgumentException |
|
412 | * @throws \PHPDaemon\Clients\AMQP\Driver\Protocol\Exception\AMQPProtocolException |
|
413 | */ |
|
414 | public function purgeQueue($name, array $options = [], callable $callback = null) |
|
415 | { |
|
416 | $noWait = array_key_exists('noWait', $options) ? (bool)$options['noWait'] : null; |
|
417 | ||
418 | $outputFrame = Queue\QueuePurgeFrame::create($name, $noWait); |
|
419 | $outputFrame->frameChannelId = $this->id; |
|
420 | $this->connection->command($outputFrame); |
|
421 | ||
422 | if (is_callable($callback)) { |
|
423 | $this->on(self::EVENT_ON_CHANNEL_PURGE_QUEUE_CALLBACK, $callback); |
|
424 | } |
|
425 | } |
|
426 | ||
427 | /** |
|
428 | * Bind queue to exchange |
|
@@ 774-788 (lines=15) @@ | ||
771 | * @throws \InvalidArgumentException |
|
772 | * @throws \PHPDaemon\Clients\AMQP\Driver\Protocol\Exception\AMQPProtocolException |
|
773 | */ |
|
774 | public function get($queueName, array $options = [], callable $callback = null) |
|
775 | { |
|
776 | $noAck = array_key_exists('noAck', $options) ? $options['noAck'] : null; |
|
777 | ||
778 | $outputFrame = Basic\BasicGetFrame::create( |
|
779 | $queueName, |
|
780 | $noAck |
|
781 | ); |
|
782 | $outputFrame->frameChannelId = $this->id; |
|
783 | $this->connection->command($outputFrame); |
|
784 | ||
785 | if (is_callable($callback)) { |
|
786 | $this->on(self::EVENT_DISPATCH_MESSAGE, $callback); |
|
787 | } |
|
788 | } |
|
789 | ||
790 | /** |
|
791 | * Ack message by delivery tag |