PHP Class malkusch\lock\mutex\PredisMutex

Note: If you're going to use this mutex in a forked process, you have to call {@link seedRandom()} in each instance.
Author: Markus Malkusch ([email protected])
Inheritance: extends RedisMutex
Datei anzeigen Open project: malkusch/lock Class Usage Examples

Public Methods

Method Description
__construct ( array $clients, string $name, integer $timeout = 3 ) Sets the Redis connections.

Protected Methods

Method Description
add ( $client, $key, $value, $expire )
evalScript ( $client, $script, $numkeys, array $arguments )
getRedisIdentifier ( $client )

Method Details

__construct() public method

Sets the Redis connections.
public __construct ( array $clients, string $name, integer $timeout = 3 )
$clients array The Redis clients.
$name string The lock name.
$timeout integer The time in seconds a lock expires, default is 3.

add() protected method

protected add ( $client, $key, $value, $expire )

evalScript() protected method

protected evalScript ( $client, $script, $numkeys, array $arguments )
$arguments array

getRedisIdentifier() protected method

protected getRedisIdentifier ( $client )