当前位置: 首页>>代码示例>>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;未经允许,请勿转载。