本文整理汇总了PHP中Aws\Sqs\SqsClient::purgeQueue方法的典型用法代码示例。如果您正苦于以下问题:PHP SqsClient::purgeQueue方法的具体用法?PHP SqsClient::purgeQueue怎么用?PHP SqsClient::purgeQueue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Aws\Sqs\SqsClient
的用法示例。
在下文中一共展示了SqsClient::purgeQueue方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: purgeQueue
/**
* @inheritdoc
*
* @throws SqsException
*/
public function purgeQueue($queueName, $priority = null)
{
if (null === $priority) {
$priorities = $this->priorityHandler->getAll();
foreach ($priorities as $priority) {
$this->purgeQueue($queueName, $priority);
}
return $this;
}
if (empty($queueName)) {
throw new InvalidArgumentException('Parameter queueName empty or not defined.');
}
$queueUrl = $this->sqsClient->getQueueUrl(['QueueName' => $this->getQueueNameWithPrioritySuffix($queueName, $priority)])->get('QueueUrl');
$this->sqsClient->purgeQueue(['QueueUrl' => $queueUrl]);
return $this;
}
示例2: purgeQueue
/**
* @inheritdoc
*
* @throws \InvalidArgumentException
* @throws QueueAccessException
*/
public function purgeQueue($queueName, Priority $priority = null)
{
if (null === $priority) {
$priorities = $this->priorityHandler->getAll();
foreach ($priorities as $priority) {
$this->purgeQueue($queueName, $priority);
}
return $this;
}
if (empty($queueName)) {
throw new \InvalidArgumentException('Queue name empty or not defined.');
}
try {
$queueUrl = $this->sqsClient->getQueueUrl(['QueueName' => $this->getQueueNameWithPrioritySuffix($queueName, $priority)])->get('QueueUrl');
$this->sqsClient->purgeQueue(['QueueUrl' => $queueUrl]);
} catch (SqsException $e) {
throw new QueueAccessException('Cannot purge queue', 0, $e);
}
return $this;
}
示例3: purge
/**
* @inheritdoc
*/
public function purge($queue)
{
$this->sqs->purgeQueue(['QueueUrl' => $queue]);
}
示例4: purge
public function purge()
{
$this->client->purgeQueue(["QueueUrl" => $this->getQueueUrl()]);
}