Drupal 8  8.0.2
DatabaseLockBackend Class Reference
Inheritance diagram for DatabaseLockBackend:

Public Member Functions

 __construct (\Symfony\Component\DependencyInjection\ContainerInterface $container, $drupal_proxy_original_service_id)
 
 acquire ($name, $timeout=30)
 
 lockMayBeAvailable ($name)
 
 release ($name)
 
 releaseAll ($lock_id=NULL)
 
 wait ($name, $delay=30)
 
 getLockId ()
 

Protected Member Functions

 lazyLoadItself ()
 

Protected Attributes

 $drupalProxyOriginalServiceId
 
 $service
 
 $container
 

Detailed Description

Provides a proxy class for .

See Also

Constructor & Destructor Documentation

__construct ( \Symfony\Component\DependencyInjection\ContainerInterface  $container,
  $drupal_proxy_original_service_id 
)

Constructs a ProxyClass Drupal proxy object.

Parameters
\Symfony\Component\DependencyInjection\ContainerInterface$containerThe container.
string$drupal_proxy_original_service_idThe service ID of the original service.

Member Function Documentation

acquire (   $name,
  $timeout = 30 
)

{Acquires a lock.

Parameters
string$nameLock name. Limit of name's length is 255 characters.
float$timeout= 30.0 (optional) Lock lifetime in seconds.
Returns
bool
}

Implements LockBackendInterface.

References DatabaseLockBackend\lazyLoadItself().

Here is the call graph for this function:

getLockId ( )

{Gets the unique page token for locks.Locks will be wiped out at the end of each page request on a token basis.

Returns
string
}

Implements LockBackendInterface.

References DatabaseLockBackend\lazyLoadItself().

Here is the call graph for this function:

lazyLoadItself ( )
protected

Lazy loads the real service from the container.

Returns
object Returns the constructed real service.

References Drupal\service().

Referenced by DatabaseLockBackend\acquire(), DatabaseLockBackend\getLockId(), DatabaseLockBackend\lockMayBeAvailable(), DatabaseLockBackend\release(), DatabaseLockBackend\releaseAll(), and DatabaseLockBackend\wait().

Here is the call graph for this function:

Here is the caller graph for this function:

lockMayBeAvailable (   $name)

{Checks if a lock is available for acquiring.

Parameters
string$nameLock to acquire.
Returns
bool
}

Implements LockBackendInterface.

References DatabaseLockBackend\lazyLoadItself().

Here is the call graph for this function:

release (   $name)

{Releases the given lock.

Parameters
string$name
}

Implements LockBackendInterface.

References DatabaseLockBackend\lazyLoadItself().

Here is the call graph for this function:

releaseAll (   $lock_id = NULL)

{Releases all locks for the given lock token identifier.

Parameters
string$lockId(optional) If none given, remove all locks from the current page. Defaults to NULL.
}

Implements LockBackendInterface.

References DatabaseLockBackend\lazyLoadItself().

Here is the call graph for this function:

wait (   $name,
  $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.

Parameters
string$nameLock name currently being locked.
int$delay= 30 Milliseconds to wait for.
Returns
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.
}

Implements LockBackendInterface.

References DatabaseLockBackend\lazyLoadItself().

Here is the call graph for this function:


The documentation for this class was generated from the following file: