本文整理汇总了PHP中AMQPExchange::getChannel方法的典型用法代码示例。如果您正苦于以下问题:PHP AMQPExchange::getChannel方法的具体用法?PHP AMQPExchange::getChannel怎么用?PHP AMQPExchange::getChannel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AMQPExchange
的用法示例。
在下文中一共展示了AMQPExchange::getChannel方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: declareAnonQueue
/**
* @return AMQPQueue
*/
protected function declareAnonQueue()
{
// first declare the queue that we need for reply
$queue = new AMQPQueue($this->exchange->getChannel());
// declare an anon queue
$queue->setFlags(AMQP_EXCLUSIVE);
$queue->declareQueue();
return $queue;
}
示例3: declareResponseQueue
/**
* @param \AMQPExchange $exchange
* @return \AMQPQueue
*/
protected function declareResponseQueue(\AMQPExchange $exchange)
{
$queue = new \AMQPQueue($exchange->getChannel());
$queue->setFlags(AMQP_EXCLUSIVE);
if ($this->queueTimeout !== null) {
$queue->setArgument("x-expires", $this->queueTimeout);
}
$queue->declareQueue();
return $queue;
}
示例4: 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;
}