class Factory implements LoggerAwareInterface

Factory provides method to create locks.

Traits

LoggerAwareTrait

Methods

__construct(StoreInterface $store)

No description

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