You are here

public function MemcacheLockBackend::__construct in Memcache API and Integration 8.2

Constructs a new MemcacheLockBackend.

Parameters

string $bin: The bin name for this lock.

\Drupal\memcache\DrupalMemcacheInterface $memcache: The memcache wrapper object.

File

src/Lock/MemcacheLockBackend.php, line 42

Class

MemcacheLockBackend
Defines a Memcache lock backend.

Namespace

Drupal\memcache\Lock

Code

public function __construct($bin, DrupalMemcacheInterface $memcache) {
  $this->bin = $bin;
  $this->memcache = $memcache;

  // __destruct() is causing problems with garbage collections, register a
  // shutdown function instead.
  drupal_register_shutdown_function([
    $this,
    'releaseAll',
  ]);
}