本文整理汇总了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]);
}
示例2: release
/**
* {@inheritdoc}
*/
public function release(int $delay = 0)
{
parent::release($delay);
$this->sqs->changeMessageVisibility(['QueueUrl' => $this->queue, 'ReceiptHandle' => $this->job['ReceiptHandle'], 'VisibilityTimeout' => $delay]);
}
示例3: returnMessage
/**
* {@inheritDoc}
*/
public function returnMessage(QueueMessage $message)
{
$queueUrl = $this->getQueueUrl($message->getQueueId());
$this->queueClient->changeMessageVisibility(["QueueUrl" => $queueUrl, "ReceiptHandle" => $message->getReceiptId(), "VisibilityTimeout" => 0]);
}
示例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;
}
示例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;
}
}
示例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;
}
}