Skip to content

bamada/redlock-php

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

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');

About

An implementation of RedLock algorithm

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages