You are here

public function PhpRedis::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/PhpRedis.php, line 103

Class

PhpRedis
Predis lock backend implementation.

Namespace

Drupal\redis\Lock

Code

public function lockMayBeAvailable($name) {
  $key = $this
    ->getKey($name);
  $value = $this->client
    ->get($key);
  return $value === FALSE || $value === NULL;
}