You are here

public function PhpRedis::deleteQueue in Redis 8

Deletes a queue and every item in the queue.

Overrides QueueInterface::deleteQueue

File

src/Queue/PhpRedis.php, line 121

Class

PhpRedis
Redis queue implementation using PhpRedis extension backend.

Namespace

Drupal\redis\Queue

Code

public function deleteQueue() {
  $keys_to_remove = [
    $this->claimedListKey,
    $this->availableListKey,
    $this->availableItems,
    $this->incrementCounterKey,
  ];
  foreach ($this->client
    ->keys($this->leasedKeyPrefix . '*') as $key) {
    $keys_to_remove[] = $key;
  }
  $this->client
    ->del($keys_to_remove);
}