close() public method

Closes the channel.
public close ( )
Exemplo n.º 1
0
 /**
  * Close the channel and connections to AMQP
  *
  * @return void
  */
 public function closeConnections()
 {
     if ($this->channel) {
         $this->channel->close();
     }
     if ($this->connection) {
         $this->connection->close();
     }
 }
Exemplo n.º 2
0
 public function __destruct()
 {
     $this->channel->close();
     unset($this->channel);
     $this->connection->close();
     unset($this->connection);
     unset($this->replyQueueName);
     unset($this->consumerTag);
     unset($this->outputMessages);
 }
 public function tearDown()
 {
     if ($this->channel) {
         $this->channel->queue_delete($this->queueName . '1');
         $this->channel->close();
     }
     if ($this->connection) {
         $this->connection->close();
     }
 }
 public function close()
 {
     if ($this->closed != true) {
         if ($this->channel != null) {
             $this->channel->close();
             $this->channel = null;
         }
         if ($this->connection != null) {
             $this->connection->close();
             $this->connection = null;
         }
         $this->closed = true;
     }
 }
Exemplo n.º 5
0
 /**
  * destructor
  */
 public function __destruct() {
     if($this->socket){
         echo "Closing socket...";
         socket_close($this->socket);
         echo "OK.\n\n";
     }
     if($this->amqChannel){
         echo "Closing AMQ Channel...";
         $this->amqChannel->close();
         echo "OK.\n\n";
     }
     if($this->amqConn){
         echo "Closing AMQ Connection...";
         $this->amqConn->close();
         echo "OK.\n\n";
     }
 }
Exemplo n.º 6
0
 /**
  * Closed AMQP connection
  */
 public function closeConnection()
 {
     $this->channel->close();
     $this->connection->close();
 }