PHP Class malkusch\lock\mutex\MemcacheMutex

Deprecation: 1.0.0 Use MemcachedMutex together with ext-memcached.
Author: Markus Malkusch ([email protected])
Inheritance: extends SpinlockMutex
Datei anzeigen Open project: malkusch/lock

Public Methods

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

Protected Methods

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

Method Details

__construct() public method

The Memcache API needs to be connected to a server. I.e. Memcache::connect() was already called.
public __construct ( string $name, Memcache $memcache, integer $timeout = 3 )
$name string The lock name.
$memcache Memcache The connected Memcache 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 )