You are here

class MongodbLockPersistent in MongoDB 8

Hierarchy

Expanded class hierarchy of MongodbLockPersistent

1 string reference to 'MongodbLockPersistent'
mongodb.services.yml in ./mongodb.services.yml
mongodb.services.yml
1 service uses MongodbLockPersistent
mongodb.lock.persistent in ./mongodb.services.yml
Drupal\mongodb\MongodbLockPersistent

File

src/MongodbLockPersistent.php, line 10
Contains \Drupal\mongodb\MongodbLockPersistent.

Namespace

Drupal\mongodb
View source
class MongodbLockPersistent extends MongodbLock {
  public function __construct(MongoCollectionFactory $mongo) {

    // Do not call the parent constructor to avoid registering a shutdown
    // function that releases all the locks at the end of a request.
    $this->mongo = $mongo;

    // 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
MongodbLock::$mongo protected property The mongodb factory registered as a service.
MongodbLock::acquire public function Acquires a lock. Overrides LockBackendInterface::acquire
MongodbLock::lockMayBeAvailable public function Checks if a lock is available for acquiring. Overrides LockBackendInterface::lockMayBeAvailable
MongodbLock::mongoCollection protected function
MongodbLock::mongoId protected function
MongodbLock::release public function Releases the given lock. Overrides LockBackendInterface::release
MongodbLock::releaseAll public function Releases all locks for the given lock token identifier. Overrides LockBackendInterface::releaseAll
MongodbLockPersistent::__construct public function Construct the DatabaseFileUsageBackend. Overrides MongodbLock::__construct