class Predis in Redis 8
Same name in this branch
- 8 src/Lock/Predis.php \Drupal\redis\Lock\Predis
- 8 src/Flood/Predis.php \Drupal\redis\Flood\Predis
- 8 src/Queue/Predis.php \Drupal\redis\Queue\Predis
- 8 src/Client/Predis.php \Drupal\redis\Client\Predis
- 8 src/Cache/Predis.php \Drupal\redis\Cache\Predis
- 8 src/PersistentLock/Predis.php \Drupal\redis\PersistentLock\Predis
Predis persistent lock backend
Hierarchy
- class \Drupal\Core\Lock\LockBackendAbstract implements LockBackendInterface
- class \Drupal\redis\Lock\Predis uses RedisPrefixTrait
- class \Drupal\redis\PersistentLock\Predis
- class \Drupal\redis\Lock\Predis uses RedisPrefixTrait
Expanded class hierarchy of Predis
3 string references to 'Predis'
- ClientFactory::getClientInterface in src/
ClientFactory.php - Lazy instantiates client proxy depending on the actual configuration.
- Predis::getName in src/
Client/ Predis.php - Get underlying library name used.
- RedisCacheTagsChecksum::doInvalidateTags in src/
Cache/ RedisCacheTagsChecksum.php - Marks cache items with any of the specified tags as invalid.
File
- src/
PersistentLock/ Predis.php, line 10
Namespace
Drupal\redis\PersistentLockView source
class Predis extends \Drupal\redis\Lock\Predis {
/**
* Creates a Predis persistent lock backend.
*/
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';
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
LockBackendAbstract:: |
protected | property | Current page lock token identifier. | |
LockBackendAbstract:: |
protected | property | Existing locks for this page. | |
LockBackendAbstract:: |
public | function |
Gets the unique page token for locks. Overrides LockBackendInterface:: |
|
LockBackendAbstract:: |
public | function |
Waits a short amount of time before a second lock acquire attempt. Overrides LockBackendInterface:: |
|
Predis:: |
protected | property | ||
Predis:: |
public | function |
Acquires a lock. Overrides LockBackendInterface:: |
|
Predis:: |
protected | function | Generate a redis key name for the current lock name. | |
Predis:: |
public | function |
Checks if a lock is available for acquiring. Overrides LockBackendInterface:: |
|
Predis:: |
public | function |
Releases the given lock. Overrides LockBackendInterface:: |
|
Predis:: |
public | function |
Releases all locks for the given lock token identifier. Overrides LockBackendInterface:: |
|
Predis:: |
public | function |
Creates a Predis persistent lock backend. Overrides Predis:: |
|
RedisPrefixTrait:: |
protected | property | ||
RedisPrefixTrait:: |
protected | function | Get global default prefix | |
RedisPrefixTrait:: |
protected | function | Get prefix | |
RedisPrefixTrait:: |
public | function | Set prefix |