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


PHP AMQPChannel::basic_ack方法代码示例

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


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

示例1: consume

 /**
  * @param $queue
  *
  * @return mixed
  */
 public function consume($queue)
 {
     $messageBody = false;
     $message = $this->ch->basic_get($queue);
     if ($message) {
         $this->ch->basic_ack($message->delivery_info['delivery_tag']);
         $messageBody = $message->body;
     }
     return $messageBody;
 }
开发者ID:miracle84,项目名称:johnny5,代码行数:15,代码来源:RabbitMQService.php

示例2: thereShouldBeAMessageInQueue

 /**
  * @Then there should be a message in queue :queue
  *
  * @param              $queue
  * @param PyStringNode $string
  */
 public function thereShouldBeAMessageInQueue($queue, PyStringNode $string = null)
 {
     $expected = $string ? $string->getRaw() : null;
     if (null === $expected) {
         $this->channel->basic_consume($queue);
     } else {
         $consumer = function (AMQPMessage $message) use($expected) {
             $this->channel->basic_ack($message->delivery_info['delivery_tag']);
             Assert::that($message->body)->equal($expected);
         };
         $this->channel->basic_consume($queue, '', false, false, false, false, $consumer);
     }
     $this->channel->wait(null, false, 4);
 }
开发者ID:DrSchimke,项目名称:Lepus,代码行数:20,代码来源:LepusContext.php

示例3: ack

 public function ack(MessageInterface $message)
 {
     if ($this->isConnected()) {
         $this->channel->basic_ack($message->get('delivery_tag'));
         $this->logger->info(sprintf("Sent Ack for %n message", $message->get('delivery_tag')));
     }
 }
开发者ID:danielsan80,项目名称:async-task,代码行数:7,代码来源:RabbitMqService.php

示例4: handle

 /**
  * @param AMQPMessage $message
  *
  * @throws \Exception
  */
 public function handle(AMQPMessage $message)
 {
     $reply = null;
     try {
         $reply = $this->handler->handle($message);
         $this->channel->basic_ack($message->delivery_info['delivery_tag'], false);
     } catch (RequestNotSupportedException $exception) {
         $this->channel->basic_ack($message->delivery_info['delivery_tag'], false);
     } catch (\Exception $e) {
         $this->channel->basic_reject($message->delivery_info['delivery_tag'], false);
         throw $e;
     }
     if ($reply !== null) {
         $this->channel->basic_publish($reply, '', $message->get('reply_to'));
     }
 }
开发者ID:skolodyazhnyy,项目名称:message-bus-client,代码行数:21,代码来源:Consumer.php

示例5:

 function it_releases_job_onto_rabbitmq(AMQPChannel $channel, RabbitMQQueue $queue)
 {
     // delete
     $channel->basic_ack('fooTagId')->shouldBeCalled();
     // release with attempts added into body
     $queue->later(1, 'foo', [0 => "someData", "attempts" => 1], 'default')->shouldBeCalled();
     $this->release(1);
 }
开发者ID:limedeck,项目名称:laravel-queue-rabbitmq,代码行数:8,代码来源:RabbitMQJobSpec.php

示例6: getNextMessage

 /**
  * Get the next message from the queue.
  * @return AMQPMessage
  * @throws ConnectionError Thrown by self::openConnection if connection cannot be established
  */
 public function getNextMessage()
 {
     $this->openConnection();
     $message = $this->channel->basic_get($this->config->getQueueName());
     // Currently no reason to want to see any message more than once so
     // ack every message received from the queue.
     if ($message) {
         // direct delivery_info array access recommended in PhpAmqpLib documentation
         $this->channel->basic_ack($message->delivery_info['delivery_tag']);
     }
     return $message;
 }
开发者ID:ryaan-anthony,项目名称:RetailOrderManagement-SDK,代码行数:17,代码来源:AmqpApi.php

示例7: basic_ack

 /**
  * @param  string $deliveryTag
  * @return mixed
  */
 public function basic_ack($deliveryTag)
 {
     return $this->channel->basic_ack($deliveryTag);
 }
开发者ID:remi-san,项目名称:universal-amqp,代码行数:8,代码来源:AMQPLibChannel.php

示例8: acknowledge

 public function acknowledge(AMQPMessage $msg)
 {
     $this->channel->basic_ack($msg->delivery_info['delivery_tag']);
 }
开发者ID:roryy,项目名称:flatfishqueue,代码行数:4,代码来源:Channel.php

示例9: delete

 /**
  * Delete the job from the queue.
  *
  * @return void
  */
 public function delete()
 {
     parent::delete();
     $this->channel->basic_ack($this->amqpMessage->delivery_info['delivery_tag']);
 }
开发者ID:fhteam,项目名称:laravel-amqp,代码行数:10,代码来源:AMQPJob.php

示例10: ack

 /**
  * {@inheritDoc}
  */
 public function ack(Message $message)
 {
     $this->channel->basic_ack($message->getId());
 }
开发者ID:kyar,项目名称:swarrot,代码行数:7,代码来源:PhpAmqpLibMessageProvider.php

示例11: acknowledgeMessage

 /**
  * If the driver supports it, this will be called when a message
  * have been consumed.
  *
  * @param string $queueName
  * @param mixed $receipt
  */
 public function acknowledgeMessage($queueName, $receipt)
 {
     $this->channel->basic_ack($receipt);
 }
开发者ID:sheikhasadmuneer,项目名称:bernard,代码行数:11,代码来源:PhpAmqpDriver.php

示例12: delete

 /**
  * Delete the job from the queue.
  */
 public function delete()
 {
     parent::delete();
     $this->channel->basic_ack($this->job->get('delivery_tag'));
 }
开发者ID:limedeck,项目名称:laravel-queue-rabbitmq,代码行数:8,代码来源:RabbitMQJob.php

示例13: ack

 /**
  * Acknowledges the message as received and processed.
  *
  * If the message is persistent (delivery_mode 2), we'll need to notify the broker
  * that it has been processed. The message will persist in the queue until it
  * has been acknowledged.
  *
  * @param int $deliveryId
  *
  * @return $this
  */
 public function ack($deliveryId)
 {
     $this->channel->basic_ack($deliveryId);
     return $this;
 }
开发者ID:znk3r,项目名称:mqlib,代码行数:16,代码来源:Channel.php

示例14: acknowledgeMessage

 public static function acknowledgeMessage(\PhpAmqpLib\Channel\AMQPChannel $channel, \PhpAmqpLib\Message\AMQPMessage $message)
 {
     $channel->basic_ack($message->delivery_info['delivery_tag']);
 }
开发者ID:TYPO3-typo3org,项目名称:community,代码行数:4,代码来源:AMQPUtils.php

示例15: completed

 /**
  * Acknowledge a job
  *
  * @access public
  * @param  Job $job
  * @return $this
  */
 public function completed(Job $job)
 {
     $this->channel->basic_ack($job->getId());
     return $this;
 }
开发者ID:fguillot,项目名称:simple-queue,代码行数:12,代码来源:AmqpQueueAdapter.php


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