public function disconnect() { if (!$this->amqp_connection) { return; } if ($this->amqp_connection->isConnected()) { $this->amqp_connection->close(); } $this->amqp_connection = null; }
/** * @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; }
/** * @param \PhpAmqpLib\Channel\AMQPChannel $ch * @param \PhpAmqpLib\Connection\AbstractConnection $conn */ function shutdown($ch, $conn) { $ch->close(); $conn->close(); }
protected function tearDownAmqp() { $this->conn->close(); }