예제 #1
0
 /**
  * Deletes all keys from associated tags and all priorities
  *
  * @todo optimize
  * @param string $keys
  */
 private function cleanEntry($keys)
 {
     foreach (is_array($keys) ? $keys : [$keys] as $key) {
         $entries = $this->entryTags($key);
         $this->client->multi();
         foreach ($entries as $tag) {
             $this->client->sRem($this->formatKey($tag, self::KEYS), $key);
         }
         // drop tags of entry and priority, in case there are some
         $this->client->del($this->formatKey($key, self::TAGS), $this->formatKey($key, self::PRIORITY));
         $this->client->zRem($this->formatKey(self::PRIORITY), $key);
         $this->client->exec();
     }
 }
예제 #2
0
파일: QueueManager.php 프로젝트: bazo/qu
 /**
  * @param string $queue
  * @return QueueManager
  */
 public function clearQueue($queue)
 {
     $this->redis->multi();
     $this->redis->sRem(self::QUEUE_KEY, $queue);
     $this->redis->lTrim($this->formatQueueKey($queue), 1, 0);
     $this->redis->exec();
     return $this;
 }