public function flushByTag($tag)
{
if ($this->isFrozen()) {
throw new \RuntimeException(sprintf('Cannot add or modify cache entry because the backend of cache "%s" is frozen.', $this->cacheIdentifier), 1323344192);
}
$script = "\n\t\tlocal entries = redis.call('SMEMBERS', KEYS[1])\n\t\tfor k1,entryIdentifier in ipairs(entries) do\n\t\t\tredis.call('DEL', ARGV[1]..'entry:'..entryIdentifier)\n\t\t\tlocal tags = redis.call('SMEMBERS', ARGV[1]..'tags:'..entryIdentifier)\n\t\t\tfor k2,tagName in ipairs(tags) do\n\t\t\t\tredis.call('SREM', ARGV[1]..'tag:'..tagName, entryIdentifier)\n\t\t\tend\n\t\t\tredis.call('DEL', ARGV[1]..'tags:'..entryIdentifier)\n\t\t\tredis.call('LREM', KEYS[2], 0, entryIdentifier)\n\t\tend\n\t\treturn #entries\n\t\t";
$count = $this->redis->eval($script, [$this->buildKey('tag:' . $tag), $this->buildKey('entries'), $this->buildKey('')], 2);
return $count;
}