W3cubDocs

/Symfony 4.1

Factory

class Factory implements LoggerAwareInterface

Factory provides method to create locks.

Traits

LoggerAwareTrait

Methods

__construct(StoreInterface $store)
Lock createLock(string $resource, float|null $ttl = 300.0, bool $autoRelease = true)

Creates a lock for the given resource.

Details

__construct(StoreInterface $store)

Parameters

StoreInterface $store

Lock createLock(string $resource, float|null $ttl = 300.0, bool $autoRelease = true)

Creates a lock for the given resource.

Parameters

string $resource The resource to lock
float|null $ttl Maximum expected lock duration in seconds
bool $autoRelease Whether to automatically release the lock or not when the lock instance is destroyed

Return Value

Lock

© 2004–2017 Fabien Potencier
Licensed under the MIT License.
https://api.symfony.com/4.1/Symfony/Component/Lock/Factory.html