return (bool) $this->
evaluate($script,
(string) $key,
[microtime(true
),
$this->
getUniqueToken($key)]);
} private function evaluate(string
$script, string
$resource, array
$args): mixed
{ if ($this->redis instanceof \Redis ||
$this->redis instanceof Relay ||
$this->redis instanceof \RedisCluster
) { $this->redis->
clearLastError();
$result =
$this->redis->
eval($script,
array_merge([$resource],
$args), 1
);
if (null !==
$err =
$this->redis->
getLastError()) { throw new LockStorageException($err);
} return $result;
} if ($this->redis instanceof \RedisArray
) { $client =
$this->redis->
_instance($this->redis->
_target($resource));
$client->
clearLastError();
$result =
$client->
eval($script,
array_merge([$resource],
$args), 1
);
if (null !==
$err =
$client->
getLastError()) { throw new LockStorageException($err);
}