/** * Returns whether or not the connection is running * * @return bool */ public function isRunning() { if (null === $this->connection) { return false; } return $this->connection->isConnected(); }
/** * Close the connection to RabbitMQ. */ public function __destruct() { if ($this->connection->isConnected()) { $this->connection->close(); } }