Example #1
0
 /**
  * Remove an item with a given key, index or value.
  *
  * @param  string  $key
  * @param  string  $value
  * @param  string  $type
  * @return bool
  */
 public function remove($key, $value, $type = null)
 {
     if (is_null($type)) {
         $type = $this->type($key);
     }
     switch ($type) {
         case 'list':
             $key = str_replace(':queued', '', $key);
             $random = Str::quickRandom(64);
             $this->database->lset($key, $value, $random);
             return $this->database->lrem($key, 1, $random);
         case 'zset':
             return $this->database->zrem($key, $value);
         default:
             throw new UnexpectedValueException("Unable to delete {$value} from {$key}. List type {$type} not supported.");
     }
 }
 /**
  * Delete a reserved job from the queue.
  *
  * @param  string  $queue
  * @param  string  $job
  * @return void
  */
 public function deleteReserved($queue, $job)
 {
     $this->redis->zrem($this->getQueue($queue) . ':reserved', $job);
 }