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


PHP AMQPQueue::reject方法代码示例

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


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

示例1: reject

 /**
  * Mark a message as explicitly not acknowledged.
  * The AMQP specification defines the basic.reject method that allows clients
  * to reject individual, delivered messages, instructing the broker
  * to either discard them or requeue them.
  *
  * @param integer $flags AMQP_REQUEUE to requeue the message(s),
  * @return bool
  */
 public function reject($flags = AMQP_REQUEUE)
 {
     if (!$this->consumed) {
         return $this->consumed = $this->queue->reject($this->getDeliveryTag(), $flags);
     }
     return $this->consumed;
 }
开发者ID:gallna,项目名称:amqp-event,代码行数:16,代码来源:ConsumeEvent.php

示例2: process

 /**
  * @param \AMQPEnvelope            $envelope
  * @param \AMQPQueue               $queue
  * @param PushPipe                 $pushPipe
  * @param string                   $errorQueue
  * @param ReceiveCancellationToken $cancellationToken
  * @param EndpointControlToken     $endpointControlToken
  *
  * @return bool
  */
 public function process(\AMQPEnvelope $envelope, \AMQPQueue $queue, PushPipe $pushPipe, $errorQueue, ReceiveCancellationToken $cancellationToken, EndpointControlToken $endpointControlToken)
 {
     try {
         $messageId = '';
         $headers = [];
         $pushMessage = false;
         try {
             $messageId = $this->messageConverter->retrieveMessageId($envelope);
             $headers = $this->messageConverter->retrieveHeaders($envelope);
             $pushMessage = true;
         } catch (\Exception $e) {
             $this->routingTopology->sendToQueue($this->brokerModel, $errorQueue, $envelope->getBody(), ['headers' => $envelope->getHeaders()]);
         }
         if ($pushMessage) {
             $pushPipe->push(new PushContext($messageId, $headers, $envelope->getBody() ?: '', $cancellationToken, $endpointControlToken));
         }
         if ($cancellationToken->isCancellationRequested()) {
             $queue->reject($envelope->getDeliveryTag(), AMQP_REQUEUE);
         } else {
             $queue->ack($envelope->getDeliveryTag());
         }
     } catch (CriticalErrorException $e) {
         // just ... die
         throw $e;
     } catch (\Exception $e) {
         $queue->reject($envelope->getDeliveryTag(), AMQP_REQUEUE);
     }
     if ($endpointControlToken->isShutdownRequested()) {
         return false;
     }
     return true;
 }
开发者ID:phpservicebus,项目名称:core,代码行数:42,代码来源:MessageProcessor.php

示例3: reject

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

示例4: reject

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

示例5: reject

 /**
  * @inheritdoc
  */
 public function reject($deliveryTag, $flags = AMQP_NOPARAM)
 {
     $this->delegate->reject($deliveryTag, self::convertToDelegateFlags($flags));
 }
开发者ID:treehouselabs,项目名称:queue,代码行数:7,代码来源:Queue.php

示例6: basic_reject

 /**
  * @param  string $deliveryTag
  * @param  boolean $requeue
  * @return mixed
  */
 public function basic_reject($deliveryTag, $requeue = true)
 {
     $this->queue->reject($deliveryTag, $requeue ? AMQP_REQUEUE : AMQP_NOPARAM);
 }
开发者ID:remi-san,项目名称:universal-amqp,代码行数:9,代码来源:AMQPExtensionChannel.php


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