Example #1
0
 /**
  * Remove binding to another exchange.
  *
  * Remove a routing key binding on an another exchange from the given exchange.
  *
  * @param string $exchangeName Name of the exchange to bind.
  * @param string $routingKey   The routing key to use for binding.
  * @param array  $arguments    Additional binding arguments.
  *
  * @return $this
  */
 public function unbind($exchangeName, $routingKey = null, array $arguments = [])
 {
     if (null === $routingKey) {
         $routingKey = '';
     }
     $name = $this->options->getName();
     $this->channel->getResource()->exchange_unbind($name, $exchangeName, $routingKey, $arguments);
     return $this;
 }
Example #2
0
 /**
  * Delete the exchange from the broker.
  *
  * @param bool   $ifUnused      Optional if the exchange should not be
  *                              deleted until no clients are connected to
  *                              it.
  * @param bool   $noWait        No wait for a reply
  *
  * @return $this
  * @throws \AMQPExchangeException
  * @throws \AMQPChannelException
  * @throws \AMQPConnectionException
  */
 public function delete($ifUnused = false, $noWait = false)
 {
     $flags = AMQP_NOPARAM;
     if ($ifUnused) {
         $flags |= AMQP_IFUNUSED;
     }
     if ($noWait) {
         $flags |= AMQP_NOWAIT;
     }
     $this->resource->delete($this->options->getName(), $flags);
     return $this;
 }