You are here

public static function Redis_Lock::getBackend in Redis 7.2

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

Get actual lock backend.

Return value

Redis_Lock_Backend_Interface

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();
  }
  return self::$instance;
}