Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. LockFactory.php

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\Lock

Code

public function createLock(string $resource, ?float $ttl = 300.0, bool $autoRelease = true) : SharedLockInterface {
    return $this->createLockFromKey(new Key($resource), $ttl, $autoRelease);
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal