interface LockInterface
LockInterface defines an interface to manipulate the status of a lock.
@author Jérémy Derussé <jeremy@derusse.com>
Hierarchy
- interface \Symfony\Component\Lock\LockInterface
Expanded class hierarchy of LockInterface
All classes that implement LockInterface
1 file declares its use of LockInterface
- LockableTrait.php in vendor/
symfony/ console/ Command/ LockableTrait.php
File
-
vendor/
symfony/ lock/ LockInterface.php, line 23
Namespace
Symfony\Component\LockView source
interface LockInterface {
/**
* 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.
*
* @throws LockConflictedException If the lock is acquired by someone else in blocking mode
* @throws LockAcquiringException If the lock cannot be acquired
*/
public function acquire(bool $blocking = false) : bool;
/**
* Increase the duration of an acquired lock.
*
* @param float|null $ttl Maximum expected lock duration in seconds
*
* @throws LockConflictedException If the lock is acquired by someone else
* @throws LockAcquiringException If the lock cannot be refreshed
*/
public function refresh(?float $ttl = null) : void;
/**
* Returns whether or not the lock is acquired.
*/
public function isAcquired() : bool;
/**
* Release the lock.
*
* @throws LockReleasingException If the lock cannot be released
*/
public function release() : void;
public function isExpired() : bool;
/**
* Returns the remaining lifetime in seconds.
*/
public function getRemainingLifetime() : ?float;
}
Members
Title Sort descending | Modifiers | Object type | Summary | Overrides |
---|---|---|---|---|
LockInterface::acquire | public | function | 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. |
2 |
LockInterface::getRemainingLifetime | public | function | Returns the remaining lifetime in seconds. | 2 |
LockInterface::isAcquired | public | function | Returns whether or not the lock is acquired. | 2 |
LockInterface::isExpired | public | function | 2 | |
LockInterface::refresh | public | function | Increase the duration of an acquired lock. | 2 |
LockInterface::release | public | function | Release the lock. | 2 |