interface LockInterface
LockInterface defines an interface to manipulate the status of a lock.
bool | acquire(bool $blocking = false) Acquires the lock. If the lock is acquired by someone else, the parameter | |
refresh() Increase the duration of an acquired lock. | ||
bool | isAcquired() Returns whether or not the lock is acquired. | |
release() Release the lock. | ||
bool | isExpired() | |
float|null | getRemainingLifetime() Returns the remaining lifetime. |
Acquires the lock. If the lock is acquired by someone else, the parameter blocking
determines whether or not the call should block until the release of the lock.
bool | $blocking | Whether or not the Lock should wait for the release of someone else |
bool | whether or not the lock had been acquired |
LockConflictedException | If the lock is acquired by someone else in blocking mode |
LockAcquiringException | If the lock can not be acquired |
Increase the duration of an acquired lock.
LockConflictedException | If the lock is acquired by someone else |
LockAcquiringException | If the lock can not be refreshed |
Returns whether or not the lock is acquired.
bool |
Release the lock.
LockReleasingException | If the lock can not be released |
bool |
Returns the remaining lifetime.
float|null | Remaining lifetime in seconds. Null when the lock won't expire. |
© 2004–2017 Fabien Potencier
Licensed under the MIT License.
https://api.symfony.com/4.1/Symfony/Component/Lock/LockInterface.html