class MemcacheLockFactory in Memcache API and Integration 8.2
THe memcache lock factory.
Hierarchy
- class \Drupal\memcache\Lock\MemcacheLockFactory
Expanded class hierarchy of MemcacheLockFactory
1 string reference to 'MemcacheLockFactory'
1 service uses MemcacheLockFactory
File
- src/
Lock/ MemcacheLockFactory.php, line 10
Namespace
Drupal\memcache\LockView source
class MemcacheLockFactory {
/**
* The bin name for this lock.
*
* @var string
*/
protected $bin = 'semaphore';
/**
* The memcache factory.
*
* @var \Drupal\memcache\Driver\MemcacheDriverFactory
*/
protected $factory;
/**
* Constructs a new MemcacheLockFactory.
*
* @param \Drupal\memcache\Driver\MemcacheDriverFactory $memcache_factory
* The memcache factory.
*/
public function __construct(MemcacheDriverFactory $memcache_factory) {
$this->factory = $memcache_factory;
}
/**
* Gets a lock backend instance.
*
* @return \Drupal\Core\Lock\LockBackendInterface
* A locked Memcache backend instance.
*/
public function get() {
return new MemcacheLockBackend($this->bin, $this->factory
->get($this->bin));
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
MemcacheLockFactory:: |
protected | property | The bin name for this lock. | |
MemcacheLockFactory:: |
protected | property | The memcache factory. | |
MemcacheLockFactory:: |
public | function | Gets a lock backend instance. | |
MemcacheLockFactory:: |
public | function | Constructs a new MemcacheLockFactory. |