An implementation of RedLock algorithm
Based on Based on Redlock-rb
Initialize lock manager:
//Initialize connection
$servers = [
['127.0.0.1', 6379, 0.01],
['127.0.0.1', 6389, 0.01]
];
$lockManager = new LockManager($servers);
Acquire lock:
$lockResult = $lockManager->lock('foo');//Return true when the lock is acquired false otherwise
Release lock:
//release locked value
$lockManager->unlock('foo');