You are here

public static function Redis_Lock::setBackend in Redis 7

Set the current lock backend.

Parameters

Redis_Lock_Backend_Interface $lockBackend:

2 calls to Redis_Lock::setBackend()
phpredis.lock.inc in ./phpredis.lock.inc
Drupal core lock.inc implementation using Redis via PhpRedis extension.
predis.lock.inc in ./predis.lock.inc
Drupal core lock.inc implementation using Redis via Predis library.

File

lib/Redis/Lock.php, line 17

Class

Redis_Lock
Lock backend singleton handling.

Code

public static function setBackend(Redis_Lock_Backend_Interface $lockBackend) {
  if (isset(self::$__instance)) {
    throw new Exception("Lock backend already set, changing it would cause already acquired locks to stall.");
  }
  self::$__instance = $lockBackend;
}