function LockBackendInterface::wait

Same name in other branches
  1. 8.9.x core/lib/Drupal/Core/Lock/LockBackendInterface.php \Drupal\Core\Lock\LockBackendInterface::wait()
  2. 10 core/lib/Drupal/Core/Lock/LockBackendInterface.php \Drupal\Core\Lock\LockBackendInterface::wait()
  3. 11.x core/lib/Drupal/Core/Lock/LockBackendInterface.php \Drupal\Core\Lock\LockBackendInterface::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.

4 methods override LockBackendInterface::wait()
DatabaseLockBackend::wait in core/lib/Drupal/Core/ProxyClass/Lock/DatabaseLockBackend.php
Waits a short amount of time before a second lock acquire attempt.
LockBackendAbstract::wait in core/lib/Drupal/Core/Lock/LockBackendAbstract.php
Waits a short amount of time before a second lock acquire attempt.
NullLockBackend::wait in core/lib/Drupal/Core/Lock/NullLockBackend.php
Waits a short amount of time before a second lock acquire attempt.
PersistentDatabaseLockBackend::wait in core/lib/Drupal/Core/ProxyClass/Lock/PersistentDatabaseLockBackend.php
Waits a short amount of time before a second lock acquire attempt.

File

core/lib/Drupal/Core/Lock/LockBackendInterface.php, line 124

Class

LockBackendInterface
Lock backend interface.

Namespace

Drupal\Core\Lock

Code

public function wait($name, $delay = 30);

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.