You are here

public function Predis::deleteQueue in Redis 8

Deletes a queue and every item in the queue.

Overrides QueueInterface::deleteQueue

File

src/Queue/Predis.php, line 121

Class

Predis
Redis queue implementation using Predis library backend.

Namespace

Drupal\redis\Queue

Code

public function deleteQueue() {

  // TODO: Fixme
  $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);
}