コード例 #1
0
 /**
  * Close the running connection
  */
 public function close()
 {
     if (null !== $this->connection && $this->connection->isConnected()) {
         $this->channel->close();
         $this->connection->close();
     }
 }
コード例 #2
0
ファイル: QueueClient.php プロジェクト: RepoMon/scheduler
 /**
  *
  */
 public function __destruct()
 {
     if ($this->connection) {
         $this->channel->close();
         $this->connection->close();
     }
 }
コード例 #3
0
 public function __destroy()
 {
     if ($this->_channel) {
         $this->_channel->close();
     }
     if ($this->getConnection && $this->getConnection->isConnected()) {
         $this->getConnection->close();
     }
 }
コード例 #4
0
ファイル: Bug49Test.php プロジェクト: vongrad/loanbroker
 public function tearDown()
 {
     if ($this->ch2) {
         $this->ch2->close();
     }
     if ($this->conn) {
         $this->conn->close();
     }
 }
コード例 #5
0
ファイル: Bug40Test.php プロジェクト: adridev/php-amqplib
 public function tearDown()
 {
     if ($this->ch) {
         $this->ch->exchange_delete($this->exchange_name);
         $this->ch->close();
     }
     if ($this->conn) {
         $this->conn->close();
     }
 }
コード例 #6
0
 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();
 }
コード例 #7
0
 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;
 }
コード例 #8
0
 public function disconnect()
 {
     if ($this->isConnected()) {
         $this->channel->close();
         $this->connection->close();
         $this->logger->info("Mq Service Disconnected");
     }
 }
コード例 #9
0
 /**
  * @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;
 }
コード例 #10
0
 /**
  */
 public function shutdown()
 {
     if ($this->channel) {
         $this->channel->close();
     }
     if ($this->connection) {
         $this->connection->close();
     }
 }
コード例 #11
0
 /**
  * @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]);
     }
 }
コード例 #12
0
 public function close()
 {
     if ($this->channel != null) {
         $this->channel->close();
     }
     if ($this->connection != null) {
         $this->connection->close();
     }
 }
コード例 #13
0
 public function closeConnection()
 {
     if ($this->channel) {
         $this->channel->close();
     }
     if ($this->connection) {
         $this->connection->close();
     }
     $this->isQueueSetup = false;
     return $this;
 }
コード例 #14
0
ファイル: Base.php プロジェクト: pdedkov/cakephp-rabbit
 /**
  * Отключаемся
  *
  * @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;
 }
コード例 #15
0
 /**
  * Close channel and connection
  */
 public function close()
 {
     $this->channel && $this->channel->close();
     $this->connection->close();
 }
コード例 #16
0
 public function close($exchange_name)
 {
     $this->channel->close();
     $this->connection->close();
 }
コード例 #17
0
 /**
  * Close channel
  */
 protected function closeChannel()
 {
     $this->channel->close();
     $this->channel = null;
 }
コード例 #18
0
ファイル: Amqp.php プロジェクト: DeRain/yii-amqp
 /**
  * Closes channel and connection
  */
 public function closeConnection()
 {
     $this->_channel->close();
     $this->_connect->close();
 }
コード例 #19
0
ファイル: RabbitMq.php プロジェクト: eugenegp/uzticketstat
 public function shutdown()
 {
     $this->channel->close();
     $this->connection->close();
 }
コード例 #20
0
ファイル: Request.php プロジェクト: bschmitt/laravel-amqp
 /**
  * @param AMQPChannel          $channel
  * @param AMQPStreamConnection $connection
  */
 public static function shutdown(AMQPChannel $channel, AMQPStreamConnection $connection)
 {
     $channel->close();
     $connection->close();
 }
コード例 #21
0
 /**
  * Closes the channel and connection
  */
 public function close()
 {
     $this->channel->close();
     return (bool) $this->conn->close();
 }
コード例 #22
0
 private function tryClose(AMQPChannel $channel)
 {
     try {
         $channel->close();
     } catch (\Exception $ex) {
         $this->logger->info("Unable to close channel. It might already be closed.");
     }
 }
コード例 #23
0
 public function __destruct()
 {
     $this->channel->close();
 }
コード例 #24
0
/**
 * @param \PhpAmqpLib\Channel\AMQPChannel $ch
 * @param \PhpAmqpLib\Connection\AbstractConnection $conn
 */
function shutdown($ch, $conn)
{
    $ch->close();
    $conn->close();
}
コード例 #25
0
ファイル: AmqpWrapper.php プロジェクト: ysaroka/uploader
 /**
  * Disconnect amqp connection
  */
 public function disconnect()
 {
     $this->channel->close();
     $this->amqpConnection->close();
 }
コード例 #26
0
 /**
  * @return mixed
  */
 public function close()
 {
     return $this->channel->close();
 }
コード例 #27
0
ファイル: RabbitMQService.php プロジェクト: miracle84/johnny5
 public function __destruct()
 {
     $this->ch->close();
     $this->conn->close();
 }