当前位置: 首页>>代码示例>>PHP>>正文


PHP AMQPQueue::setArguments方法代码示例

本文整理汇总了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);
 }
开发者ID:treehouselabs,项目名称:queue,代码行数:13,代码来源:AmqpFactory.php

示例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);
 }
开发者ID:Evaneos,项目名称:Hector,代码行数:13,代码来源:QueueSpec.php

示例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;
 }
开发者ID:Evaneos,项目名称:Hector,代码行数:21,代码来源:Queue.php

示例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;
 }
开发者ID:skatrych,项目名称:amqp-base,代码行数:42,代码来源:ExtAdapter.php

示例5: setArguments

 /**
  * @inheritdoc
  */
 public function setArguments(array $arguments)
 {
     $this->queue->setArguments($arguments);
 }
开发者ID:prolic,项目名称:HumusAmqp,代码行数:7,代码来源:Queue.php

示例6: setArguments

 /**
  * @inheritdoc
  */
 public function setArguments(array $arguments)
 {
     return $this->delegate->setArguments($arguments);
 }
开发者ID:treehouselabs,项目名称:queue,代码行数:7,代码来源:Queue.php

示例7: setArguments

 /**
  * @param array $arguments
  *
  * @return bool
  */
 public function setArguments(array $arguments)
 {
     return $this->rawQueue->setArguments($arguments);
 }
开发者ID:csharpru,项目名称:yii2-amqp,代码行数:9,代码来源:Queue.php


注:本文中的AMQPQueue::setArguments方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。