當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。