You are here

public function ReliablePhpRedis::deleteQueue in Redis 8

Deletes a queue and every item in the queue.

Overrides QueueInterface::deleteQueue

File

src/Queue/ReliablePhpRedis.php, line 124

Class

ReliablePhpRedis
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);
}