function LockFactory::createLock
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:
File
-
vendor/
symfony/ lock/ LockFactory.php, line 39
Class
- LockFactory
- Factory provides method to create locks.
Namespace
Symfony\Component\LockCode
public function createLock(string $resource, ?float $ttl = 300.0, bool $autoRelease = true) : SharedLockInterface {
return $this->createLockFromKey(new Key($resource), $ttl, $autoRelease);
}