You are here

public function PersistentDatabaseLockBackend::wait in Drupal 10

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/ProxyClass/Lock/PersistentDatabaseLockBackend.php \Drupal\Core\ProxyClass\Lock\PersistentDatabaseLockBackend::wait()
  2. 9 core/lib/Drupal/Core/ProxyClass/Lock/PersistentDatabaseLockBackend.php \Drupal\Core\ProxyClass\Lock\PersistentDatabaseLockBackend::wait()

Waits a short amount of time before a second lock acquire attempt.

While this method is subject to have a generic implementation in abstract backend implementation, some backends may provide non blocking or less I/O intensive wait mechanism: this is why this method remains on the backend interface.

Parameters

string $name: Lock name currently being locked.

int $delay: Seconds to wait for. Defaults to 30.

Return value

bool TRUE if the lock holds, FALSE if it may be available. You still need to acquire the lock manually and it may fail again.

Overrides LockBackendInterface::wait

File

core/lib/Drupal/Core/ProxyClass/Lock/PersistentDatabaseLockBackend.php, line 113

Class

PersistentDatabaseLockBackend
Provides a proxy class for \Drupal\Core\Lock\PersistentDatabaseLockBackend.

Namespace

Drupal\Core\ProxyClass\Lock

Code

public function wait($name, $delay = 30) {
  return $this
    ->lazyLoadItself()
    ->wait($name, $delay);
}