Пример #1
0
 /**
  * @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
0
 /**
  * @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
0
 /**
  * @inheritdoc
  */
 public function purge($queue)
 {
     $this->sqs->purgeQueue(['QueueUrl' => $queue]);
 }
Пример #4
0
 public function purge()
 {
     $this->client->purgeQueue(["QueueUrl" => $this->getQueueUrl()]);
 }