예제 #1
0
 public function disconnect()
 {
     if (!$this->amqp_connection) {
         return;
     }
     if ($this->amqp_connection->isConnected()) {
         $this->amqp_connection->close();
     }
     $this->amqp_connection = null;
 }
예제 #2
0
 /**
  * @return $this
  */
 public function disconnect()
 {
     if ($this->connection) {
         $this->connection->close();
         $this->connection = null;
     }
     return $this;
 }
 /**
  * Shut it down, delete exchanges, queues, close connections and channels
  */
 public function tearDown()
 {
     if ($this->ch) {
         $this->ch->exchange_delete($this->exchange);
         $this->ch->queue_delete($this->queue);
         $this->ch->close();
     }
     if ($this->conn) {
         $this->conn->close();
     }
 }
 public function closeConnection()
 {
     if ($this->channel) {
         $this->channel->close();
     }
     if ($this->connection) {
         $this->connection->close();
     }
     $this->isQueueSetup = false;
     return $this;
 }
예제 #5
0
/**
 * @param \PhpAmqpLib\Channel\AMQPChannel $ch
 * @param \PhpAmqpLib\Connection\AbstractConnection $conn
 */
function shutdown($ch, $conn)
{
    $ch->close();
    $conn->close();
}
 protected function tearDownAmqp()
 {
     $this->conn->close();
 }