/** * Close the running connection */ public function close() { if (null !== $this->connection && $this->connection->isConnected()) { $this->channel->close(); $this->connection->close(); } }
/** * */ public function __destruct() { if ($this->connection) { $this->channel->close(); $this->connection->close(); } }
public function __destroy() { if ($this->_channel) { $this->_channel->close(); } if ($this->getConnection && $this->getConnection->isConnected()) { $this->getConnection->close(); } }
public function tearDown() { if ($this->ch2) { $this->ch2->close(); } if ($this->conn) { $this->conn->close(); } }
public function tearDown() { if ($this->ch) { $this->ch->exchange_delete($this->exchange_name); $this->ch->close(); } if ($this->conn) { $this->conn->close(); } }
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(); }
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; }
public function disconnect() { if ($this->isConnected()) { $this->channel->close(); $this->connection->close(); $this->logger->info("Mq Service Disconnected"); } }
/** * @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; }
/** */ public function shutdown() { if ($this->channel) { $this->channel->close(); } if ($this->connection) { $this->connection->close(); } }
/** * @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]); } }
public function close() { if ($this->channel != null) { $this->channel->close(); } if ($this->connection != null) { $this->connection->close(); } }
public function closeConnection() { if ($this->channel) { $this->channel->close(); } if ($this->connection) { $this->connection->close(); } $this->isQueueSetup = false; return $this; }
/** * Отключаемся * * @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; }
/** * Close channel and connection */ public function close() { $this->channel && $this->channel->close(); $this->connection->close(); }
public function close($exchange_name) { $this->channel->close(); $this->connection->close(); }
/** * Close channel */ protected function closeChannel() { $this->channel->close(); $this->channel = null; }
/** * Closes channel and connection */ public function closeConnection() { $this->_channel->close(); $this->_connect->close(); }
public function shutdown() { $this->channel->close(); $this->connection->close(); }
/** * @param AMQPChannel $channel * @param AMQPStreamConnection $connection */ public static function shutdown(AMQPChannel $channel, AMQPStreamConnection $connection) { $channel->close(); $connection->close(); }
/** * Closes the channel and connection */ public function close() { $this->channel->close(); return (bool) $this->conn->close(); }
private function tryClose(AMQPChannel $channel) { try { $channel->close(); } catch (\Exception $ex) { $this->logger->info("Unable to close channel. It might already be closed."); } }
public function __destruct() { $this->channel->close(); }
/** * @param \PhpAmqpLib\Channel\AMQPChannel $ch * @param \PhpAmqpLib\Connection\AbstractConnection $conn */ function shutdown($ch, $conn) { $ch->close(); $conn->close(); }
/** * Disconnect amqp connection */ public function disconnect() { $this->channel->close(); $this->amqpConnection->close(); }
/** * @return mixed */ public function close() { return $this->channel->close(); }
public function __destruct() { $this->ch->close(); $this->conn->close(); }