You are here

public static function Redis_Lock::getBackend in Redis 7.3

Same name and namespace in other branches
  1. 7 lib/Redis/Lock.php \Redis_Lock::getBackend()
  2. 7.2 lib/Redis/Lock.php \Redis_Lock::getBackend()

Get actual lock backend.

Return value

Redis_Lock_BackendInterface

File

lib/Redis/Lock.php, line 17

Class

Redis_Lock
Lock backend singleton handling.

Code

public static function getBackend() {
  if (!isset(self::$instance)) {
    $className = Redis_Client::getClass(Redis_Client::REDIS_IMPL_LOCK);
    self::$instance = new $className(Redis_Client::getClient(), Redis_Client::getDefaultPrefix('lock'));
  }
  return self::$instance;
}