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


PHP SqsClient::changeMessageVisibility方法代码示例

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


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

示例1: release

 /**
  * @inheritdoc
  */
 public function release(array $message, $delay = 0)
 {
     $this->sqs->changeMessageVisibility(['QueueUrl' => $message['queue'], 'ReceiptHandle' => $message['receipt-handle'], 'VisibilityTimeout' => $delay]);
 }
开发者ID:mithun12000,项目名称:yii2-queue,代码行数:7,代码来源:SqsQueue.php

示例2: release

 /**
  * {@inheritdoc}
  */
 public function release(int $delay = 0)
 {
     parent::release($delay);
     $this->sqs->changeMessageVisibility(['QueueUrl' => $this->queue, 'ReceiptHandle' => $this->job['ReceiptHandle'], 'VisibilityTimeout' => $delay]);
 }
开发者ID:narrowspark,项目名称:framework,代码行数:8,代码来源:SqsJob.php

示例3: returnMessage

 /**
  * {@inheritDoc}
  */
 public function returnMessage(QueueMessage $message)
 {
     $queueUrl = $this->getQueueUrl($message->getQueueId());
     $this->queueClient->changeMessageVisibility(["QueueUrl" => $queueUrl, "ReceiptHandle" => $message->getReceiptId(), "VisibilityTimeout" => 0]);
 }
开发者ID:silktide,项目名称:queueball-sqs,代码行数:8,代码来源:Queue.php

示例4: failed

 /**
  * Mark a job as failed
  *
  * @access public
  * @param  Job $job
  * @return $this
  */
 public function failed(Job $job)
 {
     $this->sqsClient->changeMessageVisibility(array('QueueUrl' => $this->sqsUrl, 'ReceiptHandle' => $job->getId(), 'VisibilityTimeout' => 0));
     return $this;
 }
开发者ID:fguillot,项目名称:simple-queue,代码行数:12,代码来源:AwsSqsQueueAdapter.php

示例5: releaseJob

 /**
  * Release the job.
  *
  * @param Job $job The job to release.
  *
  * @return boolean whether the operation succeed.
  */
 public function releaseJob(Job $job)
 {
     if (!empty($job->header['ReceiptHandle'])) {
         $receiptHandle = $job->header['ReceiptHandle'];
         $response = $this->_client->changeMessageVisibility(['QueueUrl' => $this->url, 'ReceiptHandle' => $receiptHandle, 'VisibilityTimeout' => 0]);
         return $response !== null;
     } else {
         return false;
     }
 }
开发者ID:voodoo-mobile,项目名称:yii2-queue,代码行数:17,代码来源:SqsQueue.php

示例6: release

 /**
  * Releases a message back to the queue, making it visible again
  *
  * @param Message $message
  * @return bool  returns true if successful, false otherwise
  */
 public function release(Message $message)
 {
     try {
         // Set the visibility timeout to 0 to make the message visible in the queue again straight away
         $this->sqs_client->changeMessageVisibility(array('QueueUrl' => $this->url, 'ReceiptHandle' => $message->receipt_handle, 'VisibilityTimeout' => 0));
         return true;
     } catch (Exception $e) {
         echo 'Error releasing job back to queue ' . $e->getMessage();
         return false;
     }
 }
开发者ID:Avantians,项目名称:php-sqs-tutorial,代码行数:17,代码来源:Queue.php


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