FlockStore
class FlockStore implements StoreInterface
FlockStore is a StoreInterface implementation using the FileSystem flock.
Original implementation in \Symfony\Component\Filesystem\LockHandler.
Methods
| __construct(string $lockPath = null) | ||
| save(Key $key) Stores the resource if it's not locked by someone else. | ||
| waitAndSave(Key $key) Waits until a key becomes free, then stores the resource. | ||
| putOffExpiration(Key $key, $ttl) Extends the ttl of a resource. | ||
| delete(Key $key) Removes a resource from the storage. | ||
| bool | exists(Key $key) Returns whether or not the resource exists in the storage. |
Details
__construct(string $lockPath = null)
Parameters
| string | $lockPath | the directory to store the lock, defaults to the system's temporary directory |
Exceptions
| LockStorageException | If the lock directory doesn’t exist or is not writable |
save(Key $key)
Stores the resource if it's not locked by someone else.
Parameters
| Key | $key |
Exceptions
| LockConflictedException |
waitAndSave(Key $key)
Waits until a key becomes free, then stores the resource.
If the store does not support this feature it should throw a NotSupportedException.
Parameters
| Key | $key |
Exceptions
| LockConflictedException | |
| NotSupportedException |
putOffExpiration(Key $key, $ttl)
Extends the ttl of a resource.
If the store does not support this feature it should throw a NotSupportedException.
Parameters
| Key | $key | |
| $ttl |
Exceptions
| LockConflictedException | |
| NotSupportedException |
delete(Key $key)
Removes a resource from the storage.
Parameters
| Key | $key |
bool exists(Key $key)
Returns whether or not the resource exists in the storage.
Parameters
| Key | $key |
Return Value
| bool |
© 2004–2017 Fabien Potencier
Licensed under the MIT License.
https://api.symfony.com/4.1/Symfony/Component/Lock/Store/FlockStore.html