public function Predis::lockMayBeAvailable in Redis 8
Checks if a lock is available for acquiring.
Parameters
string $name: Lock to acquire.
Return value
bool
Overrides LockBackendInterface::lockMayBeAvailable
File
- src/
Lock/ Predis.php, line 95
Class
- Predis
- Predis lock backend implementation.
Namespace
Drupal\redis\LockCode
public function lockMayBeAvailable($name) {
$key = $this
->getKey($name);
$value = $this->client
->get($key);
return $value === FALSE || $value === NULL;
}