You are here

public function LockFactory::get in Redis 8

Get actual lock backend.

Parameters

bool $persistent: (optional) Whether to return a persistent lock implementation or not.

Return value

\Drupal\Core\Lock\LockBackendInterface Return lock backend instance.

File

src/Lock/LockFactory.php, line 33

Class

LockFactory
Lock backend singleton handling.

Namespace

Drupal\redis\Lock

Code

public function get($persistent = FALSE) {
  $class_name = $this->clientFactory
    ->getClass($persistent ? ClientFactory::REDIS_IMPL_PERSISTENT_LOCK : ClientFactory::REDIS_IMPL_LOCK);
  return new $class_name($this->clientFactory);
}