當前位置: 首頁>>代碼示例>>PHP>>正文


PHP AMQPChannel::close方法代碼示例

本文整理匯總了PHP中PhpAmqpLib\Channel\AMQPChannel::close方法的典型用法代碼示例。如果您正苦於以下問題:PHP AMQPChannel::close方法的具體用法?PHP AMQPChannel::close怎麽用?PHP AMQPChannel::close使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在PhpAmqpLib\Channel\AMQPChannel的用法示例。


在下文中一共展示了AMQPChannel::close方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: close

 /**
  * Close the running connection
  */
 public function close()
 {
     if (null !== $this->connection && $this->connection->isConnected()) {
         $this->channel->close();
         $this->connection->close();
     }
 }
開發者ID:graphaware,項目名稱:php-simplemq,代碼行數:10,代碼來源:AbstractRunner.php

示例2: __destruct

 /**
  *
  */
 public function __destruct()
 {
     if ($this->connection) {
         $this->channel->close();
         $this->connection->close();
     }
 }
開發者ID:RepoMon,項目名稱:scheduler,代碼行數:10,代碼來源:QueueClient.php

示例3: __destroy

 public function __destroy()
 {
     if ($this->_channel) {
         $this->_channel->close();
     }
     if ($this->getConnection && $this->getConnection->isConnected()) {
         $this->getConnection->close();
     }
 }
開發者ID:uafrica,項目名稱:delayed-jobs,代碼行數:9,代碼來源:PhpAmqpLibDriver.php

示例4: tearDown

 public function tearDown()
 {
     if ($this->ch2) {
         $this->ch2->close();
     }
     if ($this->conn) {
         $this->conn->close();
     }
 }
開發者ID:vongrad,項目名稱:loanbroker,代碼行數:9,代碼來源:Bug49Test.php

示例5: tearDown

 public function tearDown()
 {
     if ($this->ch) {
         $this->ch->exchange_delete($this->exchange_name);
         $this->ch->close();
     }
     if ($this->conn) {
         $this->conn->close();
     }
 }
開發者ID:adridev,項目名稱:php-amqplib,代碼行數:10,代碼來源:Bug40Test.php

示例6: tearDown

 public function tearDown()
 {
     try {
         $this->object->deleteQueue('/', self::QUEUE_TEST_NAME);
     } catch (\Exception $e) {
     }
     try {
         $this->object->deleteExchange('/', self::EXCHANGE_TEST_NAME);
     } catch (\Exception $e) {
     }
     $this->channel->close();
     $this->conn->close();
 }
開發者ID:aashley,項目名稱:RabbitMQ-Management-API-Client,代碼行數:13,代碼來源:APIClientTest.php

示例7: actionIndex

 public function actionIndex()
 {
     Yii::info('Started email task', __METHOD__);
     $this->setupConnection();
     echo '[*] Waiting for messages. To exit press CTRL+C', "\n";
     $this->channel->basic_qos(null, 1, null);
     $this->channel->basic_consume($this->queue, '', false, false, false, false, [$this, 'processEmail']);
     while (count($this->channel->callbacks)) {
         $this->channel->wait();
     }
     echo 'Shutting down...', "\n";
     Yii::info('Shutting down...', __METHOD__);
     Yii::trace('Disconnecting...', __METHOD__);
     $this->channel->close();
     $this->connection->close();
     return self::EXIT_CODE_NORMAL;
 }
開發者ID:highestgoodlikewater,項目名稱:yii2-mailqueue,代碼行數:17,代碼來源:EmailTaskController.php

示例8: disconnect

 public function disconnect()
 {
     if ($this->isConnected()) {
         $this->channel->close();
         $this->connection->close();
         $this->logger->info("Mq Service Disconnected");
     }
 }
開發者ID:danielsan80,項目名稱:async-task,代碼行數:8,代碼來源:RabbitMqService.php

示例9: sendMessage

 /**
  * @inherit
  */
 public function sendMessage()
 {
     $msg = new AMQPMessage($this->data, $this->messageProperties);
     $this->channel->basic_publish($msg, $this->publishExchange, $this->publishRoutingKey, $this->publishMandatory, $this->publishImmediate, $this->publishTicket);
     $this->channel->close();
     $this->connection->close();
     return true;
 }
開發者ID:highestgoodlikewater,項目名稱:yii2-mailqueue,代碼行數:11,代碼來源:RabbitMessage.php

示例10: shutdown

 /**
  */
 public function shutdown()
 {
     if ($this->channel) {
         $this->channel->close();
     }
     if ($this->connection) {
         $this->connection->close();
     }
 }
開發者ID:Neodork,項目名稱:SonataNotificationBundle,代碼行數:11,代碼來源:AMQPBackendDispatcher.php

示例11: closeChannel

 /**
  * @return void
  */
 protected function closeChannel()
 {
     $this->channel = null;
     if ($this->channel instanceof AMQPChannel) {
         $channelId = $this->channel->getChannelId();
         $this->channel->close();
         $this->logger->info('Channel clossed!', [$channelId]);
     }
 }
開發者ID:retrinko,項目名稱:cottontail,代碼行數:12,代碼來源:PhpAmqpLibConnector.php

示例12: close

 public function close()
 {
     if ($this->channel != null) {
         $this->channel->close();
     }
     if ($this->connection != null) {
         $this->connection->close();
     }
 }
開發者ID:artox-lab,項目名稱:rabbitmq-wrapper,代碼行數:9,代碼來源:RabbitMQ.php

示例13: closeConnection

 public function closeConnection()
 {
     if ($this->channel) {
         $this->channel->close();
     }
     if ($this->connection) {
         $this->connection->close();
     }
     $this->isQueueSetup = false;
     return $this;
 }
開發者ID:ryaan-anthony,項目名稱:RetailOrderManagement-SDK,代碼行數:11,代碼來源:AmqpApi.php

示例14: _disconnect

 /**
  * Отключаемся
  *
  * @return bool
  */
 protected function _disconnect()
 {
     try {
         if ($this->_connected) {
             $this->_Channel->close();
             $this->_Connection->close();
         }
     } catch (\Exception $e) {
     }
     $this->_Channel = $this->_Connection = null;
     $this->_connected = false;
     return !$this->_connected;
 }
開發者ID:pdedkov,項目名稱:cakephp-rabbit,代碼行數:18,代碼來源:Base.php

示例15: close

 /**
  * Close channel and connection
  */
 public function close()
 {
     $this->channel && $this->channel->close();
     $this->connection->close();
 }
開發者ID:zoek1,項目名稱:php-testing-tools,代碼行數:8,代碼來源:AmqpMessageConsumer.php


注:本文中的PhpAmqpLib\Channel\AMQPChannel::close方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。