You are here

class Predis in Redis 8

Same name in this branch
  1. 8 src/Lock/Predis.php \Drupal\redis\Lock\Predis
  2. 8 src/Flood/Predis.php \Drupal\redis\Flood\Predis
  3. 8 src/Queue/Predis.php \Drupal\redis\Queue\Predis
  4. 8 src/Client/Predis.php \Drupal\redis\Client\Predis
  5. 8 src/Cache/Predis.php \Drupal\redis\Cache\Predis
  6. 8 src/PersistentLock/Predis.php \Drupal\redis\PersistentLock\Predis

Predis persistent lock backend

Hierarchy

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\PersistentLock
View 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

Namesort descending Modifiers Type Description Overrides
LockBackendAbstract::$lockId protected property Current page lock token identifier.
LockBackendAbstract::$locks protected property Existing locks for this page.
LockBackendAbstract::getLockId public function Gets the unique page token for locks. Overrides LockBackendInterface::getLockId
LockBackendAbstract::wait public function Waits a short amount of time before a second lock acquire attempt. Overrides LockBackendInterface::wait
Predis::$client protected property
Predis::acquire public function Acquires a lock. Overrides LockBackendInterface::acquire
Predis::getKey protected function Generate a redis key name for the current lock name.
Predis::lockMayBeAvailable public function Checks if a lock is available for acquiring. Overrides LockBackendInterface::lockMayBeAvailable
Predis::release public function Releases the given lock. Overrides LockBackendInterface::release
Predis::releaseAll public function Releases all locks for the given lock token identifier. Overrides LockBackendInterface::releaseAll
Predis::__construct public function Creates a Predis persistent lock backend. Overrides Predis::__construct
RedisPrefixTrait::$prefix protected property
RedisPrefixTrait::getDefaultPrefix protected function Get global default prefix
RedisPrefixTrait::getPrefix protected function Get prefix
RedisPrefixTrait::setPrefix public function Set prefix