close() public method

Closes the channel.
public close ( )
コード例 #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();
     }
 }
コード例 #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);
 }
コード例 #3
0
 public function tearDown()
 {
     if ($this->channel) {
         $this->channel->queue_delete($this->queueName . '1');
         $this->channel->close();
     }
     if ($this->connection) {
         $this->connection->close();
     }
 }
コード例 #4
0
 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;
     }
 }
コード例 #5
0
ファイル: Service.php プロジェクト: rukavina/Octopus
 /**
  * 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";
     }
 }
コード例 #6
0
ファイル: Amqp.php プロジェクト: grigorieff/yii2-amqp
 /**
  * Closed AMQP connection
  */
 public function closeConnection()
 {
     $this->channel->close();
     $this->connection->close();
 }