public function Predis::__construct in Redis 8
Same name in this branch
- 8 src/Lock/Predis.php \Drupal\redis\Lock\Predis::__construct()
- 8 src/Flood/Predis.php \Drupal\redis\Flood\Predis::__construct()
- 8 src/Queue/Predis.php \Drupal\redis\Queue\Predis::__construct()
- 8 src/Cache/Predis.php \Drupal\redis\Cache\Predis::__construct()
- 8 src/PersistentLock/Predis.php \Drupal\redis\PersistentLock\Predis::__construct()
Creates a Predis persistent lock backend.
Overrides Predis::__construct
File
- src/
PersistentLock/ Predis.php, line 15
Class
- Predis
- Predis persistent lock backend
Namespace
Drupal\redis\PersistentLockCode
public function __construct(ClientFactory $factory) {
// Do not call the parent constructor to avoid registering a shutdown
// function that releases all the locks at the end of a request.
$this->client = $factory
->getClient();
// Set the lockId to a fixed string to make the lock ID the same across
// multiple requests. The lock ID is used as a page token to relate all the
// locks set during a request to each other.
// @see \Drupal\Core\Lock\LockBackendInterface::getLockId()
$this->lockId = 'persistent';
}