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


PHP AMQPQueue::setArgument方法代码示例

本文整理汇总了PHP中AMQPQueue::setArgument方法的典型用法代码示例。如果您正苦于以下问题:PHP AMQPQueue::setArgument方法的具体用法?PHP AMQPQueue::setArgument怎么用?PHP AMQPQueue::setArgument使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在AMQPQueue的用法示例。


在下文中一共展示了AMQPQueue::setArgument方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: 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;
 }
开发者ID:boekkooi,项目名称:tactician-amqp,代码行数:14,代码来源:CommandPublisher.php

示例2: setArgument

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

示例3: setArgument

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

示例4: later

 /**
  * Push a new job onto the queue after a delay.
  *
  * @param  \DateTime|int $delay
  * @param  string        $job
  * @param  mixed         $data
  * @param  string        $queue
  *
  * @return mixed
  */
 public function later($delay, $job, $data = '', $queue = null)
 {
     $delay = $this->getSeconds($delay);
     // declare queue
     $destinationQueue = $this->getQueue($queue);
     $destinationQueue->declareQueue();
     // destination exchange
     $destinationExchange = $this->getExchangeForQueue($destinationQueue);
     // create the dead letter queue
     $deferredQueueName = sprintf('deferred from %s:%s for %ss', $destinationExchange->getName(), $destinationQueue->getName(), number_format($delay));
     $deferredQueue = new \AMQPQueue($this->channel);
     $deferredQueue->setName($deferredQueueName);
     $deferredQueue->setFlags(AMQP_DURABLE);
     $deferredQueue->setArgument('x-dead-letter-exchange', $destinationExchange->getName() ?: '');
     $deferredQueue->setArgument('x-dead-letter-routing-key', $destinationQueue->getName());
     $deferredQueue->setArgument('x-expires', (int) (1.5 * $delay * 1000));
     $deferredQueue->declareQueue();
     return $destinationExchange->publish($this->createPayload($job, $data), $deferredQueue->getName(), AMQP_NOPARAM, ['delivery_mode' => 2, 'content_type' => 'application/json', 'expiration' => (string) ($delay * 1000)]);
 }
开发者ID:garbetjie,项目名称:laravel-amqp-queue,代码行数:29,代码来源:Queue.php

示例5: getAMQPExchange

 protected function getAMQPExchange()
 {
     if (is_null(self::$_AMQPExchange)) {
         $channel = new AMQPChannel($this->getAMQPConnection());
         $exchange = new AMQPExchange($channel);
         $exchange->setName($this->getExchangeName());
         $exchange->setType($this->getExchangeType());
         $exchange->setFlags(AMQP_DURABLE);
         $exchange->declare();
         $queue = new AMQPQueue($channel);
         $queue->setName($this->getQueueName());
         $queue->setFlags(AMQP_DURABLE);
         $queue->setArgument('x-ha-policy', 'all');
         $queue->declare();
         $queue->bind($this->getExchangeName(), $this->getRoutingKey());
         self::$_AMQPExchange = $exchange;
     }
     return self::$_AMQPExchange;
 }
开发者ID:rurri,项目名称:log4php-graylog2,代码行数:19,代码来源:LoggerAppenderAMQP.php

示例6: setArgument

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


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