本文整理汇总了PHP中AMQPQueue::setArguments方法的典型用法代码示例。如果您正苦于以下问题:PHP AMQPQueue::setArguments方法的具体用法?PHP AMQPQueue::setArguments怎么用?PHP AMQPQueue::setArguments使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AMQPQueue
的用法示例。
在下文中一共展示了AMQPQueue::setArguments方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: createQueue
/**
* @inheritdoc
*/
public function createQueue(ChannelInterface $channel, $name = null, $flags = null, array $args = [])
{
$delegate = new \AMQPQueue($channel->getDelegate());
$delegate->setFlags(Queue::convertToDelegateFlags($flags));
$delegate->setArguments($args);
if (null !== $name) {
$delegate->setName($name);
}
return new Queue($delegate, $channel);
}
示例2: it_should_initialize
public function it_should_initialize(\AMQPQueue $queue, Exchange $exchange, Context $context)
{
$exchange->getName()->willReturn('exchange');
$context->getFlags()->willReturn(1234);
$context->getArguments()->willReturn(['foo' => 'bar']);
$queue->setName('queue')->shouldBeCalled();
$queue->bind('exchange')->shouldBeCalled();
$queue->setFlags(1234)->shouldBeCalled();
$queue->setArguments(['foo' => 'bar'])->shouldBeCalled();
$queue->declareQueue()->shouldBeCalled();
$this->initialize($queue);
$this->isInitialized()->shouldReturn(true);
}
示例3: initialize
/**
* @param \AMQPQueue|null $queue
*
* @throws HectorException
*/
public function initialize(\AMQPQueue $queue = null)
{
if (true === $this->isInitialized()) {
throw new HectorException('Queue already initialized');
}
if (null === $queue) {
$queue = new \AMQPQueue($this->channel->getWrappedChannel());
}
$this->queue = $queue;
$this->queue->setName($this->getName());
$this->queue->bind($this->exchange->getName());
$this->queue->setFlags($this->context->getFlags());
$this->queue->setArguments($this->context->getArguments());
$this->queue->declareQueue();
$this->initialized = true;
}
示例4: getQueue
/**
* Get queue
*
* @param string $name The queue name
*
* @return \AMQPQueue
*/
protected function getQueue($name)
{
if (isset($this->queues[$name])) {
return $this->queues[$name];
}
$config = $this->getConfig('queue', $name);
if (null === $config) {
throw new \InvalidArgumentException("Queue definition '{$name}' doesn't exists.");
}
$connection = $this->getConnection($config['connection']);
$this->queues[$name] = $queue = new \AMQPQueue($connection['channel']);
$queue->setFlags(Helper\Options::toFlags($config));
$queue->setName(is_callable($config['name']) ? call_user_func($config['name']) : $config['name']);
$queue->declareQueue();
if (isset($config['bindings'])) {
foreach ($config['bindings'] as $binding) {
try {
$this->getExchange($binding['exchange']);
} catch (\InvalidArgumentException $e) {
}
$exchangeConfig = $this->getConfig('exchange', $binding['exchange']);
$queue->bind($exchangeConfig['name'], $binding['routing_key'], isset($binding['arguments']) ? $binding['arguments'] : []);
}
}
if (!empty($config['arguments'])) {
if (isset($config['arguments']['x-dead-letter-exchange'])) {
try {
$this->getExchange($config['arguments']['x-dead-letter-exchange']);
} catch (\InvalidArgumentException $e) {
}
}
$queue->setArguments($config['arguments']);
}
return $queue;
}
示例5: setArguments
/**
* @inheritdoc
*/
public function setArguments(array $arguments)
{
$this->queue->setArguments($arguments);
}
示例6: setArguments
/**
* @inheritdoc
*/
public function setArguments(array $arguments)
{
return $this->delegate->setArguments($arguments);
}
示例7: setArguments
/**
* @param array $arguments
*
* @return bool
*/
public function setArguments(array $arguments)
{
return $this->rawQueue->setArguments($arguments);
}