DatabaseLockBackend
class DatabaseLockBackend implements LockBackendInterface (View source)
Provides a proxy class for \Drupal\Core\Lock\DatabaseLockBackend.
Traits
Provides dependency injection friendly methods for serialization.
Properties
| protected array | $_serviceIds | An array of service IDs keyed by property name used for serialization. |
from DependencySerializationTrait |
| protected array | $_entityStorages | An array of entity type IDs keyed by the property name of their storages. |
from DependencySerializationTrait |
| protected string | $drupalProxyOriginalServiceId | The id of the original proxied service. |
|
| protected DatabaseLockBackend | $service | The real proxied service, after it was lazy loaded. |
|
| protected ContainerInterface | $container | The service container. |
Methods
Constructs a ProxyClass Drupal proxy object.
Lazy loads the real service from the container.
Acquires a lock.
Checks if a lock is available for acquiring.
Releases the given lock.
Releases all locks for the given lock token identifier.
{@inheritdoc}
Waits a short amount of time before a second lock acquire attempt.
Gets the unique page token for locks.
Details
__sleep()
{@inheritdoc}
__wakeup()
{@inheritdoc}
__construct(ContainerInterface $container, string $drupal_proxy_original_service_id)
Constructs a ProxyClass Drupal proxy object.
protected object
lazyLoadItself()
Lazy loads the real service from the container.
bool
acquire(string $name, float $timeout = 30.0)
Acquires a lock.
bool
lockMayBeAvailable(string $name)
Checks if a lock is available for acquiring.
release(string $name)
Releases the given lock.
releaseAll($lock_id = NULL)
Releases all locks for the given lock token identifier.
schemaDefinition()
{@inheritdoc}
bool
wait(string $name, int $delay = 30)
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.
string
getLockId()
Gets the unique page token for locks.
Locks will be wiped out at the end of each page request on a token basis.