5 * Contains \Drupal\memcache\PersistentMemcacheLockBackend.
8 namespace Drupal\memcache\Lock;
10 use Drupal\memcache\DrupalMemcacheInterface;
12 class PersistentMemcacheLockBackend extends MemcacheLockBackend {
15 * Constructs a new MemcacheLockBackend.
17 * @param \Drupal\Memcache\DrupalMemcacheInterface $memcache
19 public function __construct($bin, DrupalMemcacheInterface $memcache) {
22 // Do not call the parent constructor to avoid registering a shutdwon
23 // function that will release all locks at the end of the request.
24 $this->memcache = $memcache;
25 // Set the lockId to a fixed string to make the lock ID the same across
26 // multiple requests. The lock ID is used as a page token to relate all the
27 // locks set during a request to each other.
28 // @see \Drupal\Core\Lock\LockBackendInterface::getLockId()
29 $this->lockId = 'persistent';