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


PHP AMQPExchange::delete方法代码示例

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


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

示例1: delete

 /**
  * @param string $exchangeName
  * @param int    $flags
  *
  * @return bool
  */
 public function delete($exchangeName = null, $flags = Client::NOPARAM)
 {
     try {
         return $this->rawExchange->delete($exchangeName, $flags);
     } catch (\Exception $e) {
         ClientHelper::throwRightException($e);
     }
 }
开发者ID:csharpru,项目名称:yii2-amqp,代码行数:14,代码来源:Exchange.php

示例2: delete

 /**
  * @inheritdoc
  */
 public function delete($exchangeName = null, $flags = null)
 {
     try {
         return $this->delegate->delete($exchangeName, self::convertToDelegateFlags($flags));
     } catch (\AMQPExchangeException $e) {
         throw new ExchangeException($e->getMessage(), $e->getCode(), $e);
     } catch (\AMQPChannelException $e) {
         throw new ChannelException($e->getMessage(), $e->getCode(), $e);
     } catch (\AMQPConnectionException $e) {
         throw new ConnectionException($e->getMessage(), $e->getCode(), $e);
     }
 }
开发者ID:treehouselabs,项目名称:queue,代码行数:15,代码来源:Exchange.php

示例3: microtime

$timer = microtime(true) - $timer;
echo '    Get: ', $iterations, ' iterations took ', $timer, 'sec', PHP_EOL;
$q->delete();
$exchange->delete();
echo PHP_EOL;
// ==================================
$exchange = new AMQPExchange($ch);
$exchange->setType(AMQP_EX_TYPE_FANOUT);
$exchange->setFlags(AMQP_AUTODELETE);
$exchange->setName('benchmark_exchange_' . microtime(true));
$exchange->declareExchange();
$q = new AMQPQueue($ch);
$q->setFlags(AMQP_AUTODELETE);
$q->declareQueue();
$q->bind($exchange->getName());
$timer = microtime(true);
for ($i = 0; $i < $iterations; $i++) {
    $exchange->publish($message);
}
$timer = microtime(true) - $timer;
echo 'Publish: ', $iterations, ' iterations took ', $timer, 'sec', PHP_EOL;
$consumer_iterations = $iterations;
$timer = microtime(true);
$q->consume(function () use(&$consumer_iterations) {
    return --$consumer_iterations > 0;
}, AMQP_AUTOACK);
$timer = microtime(true) - $timer;
echo 'Consume: ', $iterations, ' iterations took ', $timer, 'sec', PHP_EOL;
$q->delete();
$exchange->delete();
开发者ID:vstepanyuk,项目名称:php-amqp,代码行数:30,代码来源:benchmark.php

示例4: AMQPConnection

<?php

// print_r( get_loaded_extensions() );
$cnn = new AMQPConnection();
echo "------  connect ...  --------\n";
$ret = $cnn->connect();
echo "------  connect Ok  --------\n";
$ch = new AMQPChannel($cnn);
$ex = new AMQPExchange($ch);
echo "------  exchange Ok  --------\n";
// $cnn->disconnect(AMQP_NOPARAM);
$ex->setName('test_e');
$ex->delete();
$cnn->disconnect();
开发者ID:akalend,项目名称:hhvm-amqp,代码行数:14,代码来源:delete_exchange.php

示例5: delete

 /**
  * @inheritdoc
  */
 public function delete(string $exchangeName = '', int $flags = Constants::AMQP_NOPARAM)
 {
     $this->exchange->delete($exchangeName, $flags);
 }
开发者ID:prolic,项目名称:HumusAmqp,代码行数:7,代码来源:Exchange.php

示例6: send

 private function send($msg)
 {
     // Attach to well known server ETL and send message.
     $request_queue = new AMQPQueue($this->channel);
     $request_queue->setName("queue-well-known-rpc-name");
     $request_queue->declareQueue();
     $request_exch = new AMQPExchange($this->channel);
     $request_exch->setName("exchange-well-known-rpc-name");
     $request_exch->setType(AMQP_EX_TYPE_FANOUT);
     $request_exch->declareExchange();
     $request_queue->bind($request_exch->getName());
     $request_exch->publish($msg, null, AMQP_NOPARAM, ['correlation_id' => $this->correlation_id, 'reply_to' => $this->reply_queue->getName()]);
     $request_exch->delete();
 }
开发者ID:A-j-K,项目名称:php-amqp,代码行数:14,代码来源:tut-6-rpc.php


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