wudege / sil
Single Instance Lock based Redis
v1.0.2
2017-02-05 03:21 UTC
Requires
- php: ^5.6 || ^7.0
- predis/predis: ^1.1
Requires (Dev)
- phpunit/phpunit: ^5.6
- satooshi/php-coveralls: ^1.0
- squizlabs/php_codesniffer: ^2.7
This package is not auto-updated.
Last update: 2025-01-05 04:07:16 UTC
README
Single Instance Lock based Redis
INSTALL
- Use the composer command or the composer.json file. That's the recommend way. And the SDK is here
wudege/sil
$ composer require wudege/sil
USAGE
require __DIR__ . '/../vendor/autoload.php'; $config = array( 'host' => '127.0.0.1', 'port' => 6379, 'database' => 5, ); $client = new \Predis\Client($config); $lock = new \Sil\RedisSingleInstanceLock($client); $lock->acquireLock('lock-example', sha1(uniqid(mt_rand(), true)), 3000);
TEST
$ ./vendor/bin/phpunit tests/Sil/Tests
LICENSE
The MIT License (MIT). License File.