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