PHP Class malkusch\lock\mutex\MemcachedMutex

Author: Markus Malkusch ([email protected])
Inheritance: extends SpinlockMutex
Show file Open project: malkusch/lock

Public Methods

Method Description
__construct ( string $name, Memcached $memcache, integer $timeout = 3 ) Sets the lock's name and the connected Memcached API.

Protected Methods

Method Description
acquire ( $key, $expire )
release ( $key )

Method Details

__construct() public method

The Memcached API needs to have at least one server in its pool. I.e. it has to be added with Memcached::addServer().
public __construct ( string $name, Memcached $memcache, integer $timeout = 3 )
$name string The lock name.
$memcache Memcached The connected Memcached API.
$timeout integer The time in seconds a lock expires, default is 3.

acquire() protected method

protected acquire ( $key, $expire )

release() protected method

protected release ( $key )