本文整理汇总了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();
}
}
示例2: __destruct
/**
*
*/
public function __destruct()
{
if ($this->connection) {
$this->channel->close();
$this->connection->close();
}
}
示例3: __destroy
public function __destroy()
{
if ($this->_channel) {
$this->_channel->close();
}
if ($this->getConnection && $this->getConnection->isConnected()) {
$this->getConnection->close();
}
}
示例4: tearDown
public function tearDown()
{
if ($this->ch2) {
$this->ch2->close();
}
if ($this->conn) {
$this->conn->close();
}
}
示例5: tearDown
public function tearDown()
{
if ($this->ch) {
$this->ch->exchange_delete($this->exchange_name);
$this->ch->close();
}
if ($this->conn) {
$this->conn->close();
}
}
示例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();
}
示例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;
}
示例8: disconnect
public function disconnect()
{
if ($this->isConnected()) {
$this->channel->close();
$this->connection->close();
$this->logger->info("Mq Service Disconnected");
}
}
示例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;
}
示例10: shutdown
/**
*/
public function shutdown()
{
if ($this->channel) {
$this->channel->close();
}
if ($this->connection) {
$this->connection->close();
}
}
示例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]);
}
}
示例12: close
public function close()
{
if ($this->channel != null) {
$this->channel->close();
}
if ($this->connection != null) {
$this->connection->close();
}
}
示例13: closeConnection
public function closeConnection()
{
if ($this->channel) {
$this->channel->close();
}
if ($this->connection) {
$this->connection->close();
}
$this->isQueueSetup = false;
return $this;
}
示例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;
}
示例15: close
/**
* Close channel and connection
*/
public function close()
{
$this->channel && $this->channel->close();
$this->connection->close();
}