$this->namespace =
$namespace;
} protected function doSave(array
$values, int
$lifetime, array
$addTagData =
[], array
$delTagData =
[]): array
{ $eviction =
$this->
getRedisEvictionPolicy();
if ('noeviction' !==
$eviction && !
str_starts_with($eviction, 'volatile-'
)) { throw new LogicException(sprintf('Redis maxmemory-policy setting "%s" is *not* supported by RedisTagAwareAdapter, use "noeviction" or "volatile-*" eviction policies.',
$eviction));
} // serialize values
if (!
$serialized =
$this->marshaller->
marshall($values,
$failed)) { return $failed;
} // While pipeline isn't supported on RedisCluster, other setups will at least benefit from doing this in one op
$results =
$this->
pipeline(static function D
) use ($serialized,
$lifetime,
$addTagData,
$delTagData,
$failed) { // Store cache items, force a ttl if none is set, as there is no MSETEX we need to set each one
foreach ($serialized as $id =>
$value) { yield 'setEx' =>
[ $id,
0 >=
$lifetime ? self::DEFAULT_CACHE_TTL :
$lifetime,
$value,
];