SemaphoreStore
class SemaphoreStore implements StoreInterface
SemaphoreStore is a StoreInterface implementation using Semaphore as store engine.
Methods
static bool | isSupported() Returns whether or not the store is supported. | |
__construct() | ||
save(Key $key) Stores the resource if it's not locked by someone else. | ||
waitAndSave(Key $key) Waits a key becomes free, then stores the resource. | ||
delete(Key $key) Removes a resource from the storage. | ||
putOffExpiration(Key $key, float $ttl) Extends the ttl of a resource. | ||
bool | exists(Key $key) Returns whether or not the resource exists in the storage. |
Details
static bool isSupported()
Returns whether or not the store is supported.
Return Value
bool |
__construct()
save(Key $key)
Stores the resource if it's not locked by someone else.
Parameters
Key | $key | key to lock |
Exceptions
LockConflictedException |
waitAndSave(Key $key)
Waits a key becomes free, then stores the resource.
If the store does not support this feature it should throw a NotSupportedException.
Parameters
Key | $key | key to lock |
Exceptions
LockConflictedException | |
NotSupportedException |
delete(Key $key)
Removes a resource from the storage.
Parameters
Key | $key | key to remove |
putOffExpiration(Key $key, float $ttl)
Extends the ttl of a resource.
If the store does not support this feature it should throw a NotSupportedException.
Parameters
Key | $key | key to lock |
float | $ttl | amount of second to keep the lock in the store |
Exceptions
LockConflictedException | |
NotSupportedException |
bool exists(Key $key)
Returns whether or not the resource exists in the storage.
Parameters
Key | $key | key to remove |
Return Value
bool |
© 2004–2017 Fabien Potencier
Licensed under the MIT License.
http://api.symfony.com/4.0/Symfony/Component/Lock/Store/SemaphoreStore.html