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


PHP AMQPExchange::setArguments方法代码示例

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


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

示例1: initialize

 /**
  * @param \AMQPExchange|null $exchange
  *
  * @throws HectorException
  */
 public function initialize(\AMQPExchange $exchange = null)
 {
     if (null == $exchange) {
         $exchange = new \AMQPExchange($this->channel->getWrappedChannel());
     }
     $this->exchange = $exchange;
     $this->exchange->setName($this->getName());
     $this->exchange->setType($this->context->getType());
     $this->exchange->setArguments($this->context->getArguments());
     $this->exchange->setFlags((int) $this->context->getFlags());
     $this->exchange->declareExchange();
     $this->initialized = true;
 }
开发者ID:Evaneos,项目名称:Hector,代码行数:18,代码来源:Exchange.php

示例2: createExchange

 /**
  * @inheritdoc
  */
 public function createExchange(ChannelInterface $channel, $name, $type = ExchangeInterface::TYPE_DIRECT, $flags = null, array $args = [])
 {
     $delegate = new \AMQPExchange($channel->getDelegate());
     $delegate->setName($name);
     $delegate->setType($type);
     $delegate->setFlags(Exchange::convertToDelegateFlags($flags));
     $delegate->setArguments($args);
     return new Exchange($delegate, $channel);
 }
开发者ID:treehouselabs,项目名称:queue,代码行数:12,代码来源:AmqpFactory.php

示例3: getExchange

 /**
  * @return \AMQPExchange
  * @throws \Exception
  */
 protected function getExchange()
 {
     if (!$this->exchange) {
         $this->exchange = new \AMQPExchange($this->getChannel());
         $this->exchange->setName($this->exchangeConfig['name']);
         $this->exchange->setType($this->exchangeConfig['type']);
         $this->exchange->setArguments($this->exchangeConfig['arguments']);
         $this->exchange->setFlags($this->exchangeConfig['flags']);
         if (!$this->exchange->declareExchange()) {
             throw new \Exception('Can not declare exchange ' . $this->exchange->getName());
         }
     }
     return $this->exchange;
 }
开发者ID:paulchyrilov,项目名称:zf2-rabbitmq-eventbus-module,代码行数:18,代码来源:EventBusAdapter.php

示例4: exchangeDeclare

 protected function exchangeDeclare()
 {
     if ($this->exchange === null) {
         $this->exchange = new AMQPExchange($this->channel);
     }
     $this->exchange->setName($this->exchangeOptions['name']);
     $this->exchange->setType($this->exchangeOptions['type']);
     $this->exchange->setFlags($this->getFlagsFromOptions());
     $this->exchange->setArguments($this->exchangeOptions['arguments']);
     $this->exchange->declareExchange();
     foreach ($this->exchangeOptions['binding'] as $bindOpt) {
         $this->exchange->bind($bindOpt['name'], $bindOpt['routing-keys']);
     }
     $this->exchangeDeclared = true;
 }
开发者ID:umpirsky,项目名称:ko-worker,代码行数:15,代码来源:Producer.php

示例5: AMQPConnection

<?php

$cnn = new AMQPConnection();
$ret = $cnn->connect();
$ch = new AMQPChannel($cnn);
$ex = new AMQPExchange($ch);
$ex->setName('exchange-' . microtime(true));
$ex->setType(AMQP::TYPE_FANOUT);
$ex->setArguments(array("x-ha-policy" => "all"));
$ex->setFlags(AMQP::PASSIVE | AMQP::DURABLE | AMQP::AUTODELETE | AMQP::INTERNAL);
var_dump($ex);
$ex->setFlags(AMQP::NOPARAM);
echo $ex->getFlags();
$ex->setFlags(2);
echo $ex->getFlags();
$ex->setFlags(0);
echo $ex->getFlags();
$ex->setFlags(2);
echo $ex->getFlags();
// --EXPECT-- 0202
$cnn->disconnect();
开发者ID:akalend,项目名称:hhvm-amqp,代码行数:21,代码来源:declare_exchange_with_parm.php

示例6: getExchange

 /**
  * Get exchange
  *
  * @param string $name The exchange name
  *
  * @return \AMQPExchange
  */
 protected function getExchange($name)
 {
     if (isset($this->exchanges[$name])) {
         return $this->exchanges[$name];
     }
     $config = $this->getConfig('exchange', $name);
     if (null === $config) {
         throw new \InvalidArgumentException("Exchange definition '{$name}' doesn't exists.");
     }
     $connection = $this->getConnection($config['connection']);
     $this->exchanges[$name] = $exchange = new \AMQPExchange($connection['channel']);
     $exchange->setName(is_callable($config['name']) ? call_user_func($config['name']) : $config['name']);
     $exchange->setType(isset($config['type']) ? $config['type'] : 'topic');
     $exchange->setFlags(Helper\Options::toFlags($config));
     $exchange->declareExchange();
     if (isset($config['bindings'])) {
         foreach ($config['bindings'] as $binding) {
             try {
                 $this->getExchange($binding['exchange']);
             } catch (\InvalidArgumentException $e) {
             }
             $exchange->bind($binding['exchange'], $binding['routing_key'], isset($binding['arguments']) ? $binding['arguments'] : []);
         }
     }
     if (isset($config['arguments'])) {
         $exchange->setArguments($config['arguments']);
     }
     return $exchange;
 }
开发者ID:skatrych,项目名称:amqp-base,代码行数:36,代码来源:ExtAdapter.php

示例7: setArguments

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

示例8: setArguments

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


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