本文整理汇总了PHP中AMQPExchange::getConnection方法的典型用法代码示例。如果您正苦于以下问题:PHP AMQPExchange::getConnection方法的具体用法?PHP AMQPExchange::getConnection怎么用?PHP AMQPExchange::getConnection使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AMQPExchange
的用法示例。
在下文中一共展示了AMQPExchange::getConnection方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: reconnect
/**
* Attempts to reconnect on a dead connection
* Usable for long running processes, where the stale connections get collected
* after some time
*
* @return void
*/
protected function reconnect()
{
$connection = $this->exchange->getConnection();
$channel = $this->exchange->getChannel();
$connection->reconnect();
// since the channel is also dead, need to somehow revive it. This can be
// done only by calling the constructor of the channel
$channel->__construct($connection);
}
示例2: castExchange
public static function castExchange(\AMQPExchange $c, array $a, Stub $stub, $isNested)
{
$prefix = Caster::PREFIX_VIRTUAL;
$a += array($prefix . 'name' => $c->getName(), $prefix . 'flags' => self::extractFlags($c->getFlags()), $prefix . 'type' => isset(self::$exchangeTypes[$c->getType()]) ? new ConstStub(self::$exchangeTypes[$c->getType()], $c->getType()) : $c->getType(), $prefix . 'arguments' => $c->getArguments(), $prefix . 'channel' => $c->getChannel(), $prefix . 'connection' => $c->getConnection());
return $a;
}