wudege/sil

Single Instance Lock based Redis

v1.0.2 2017-02-05 03:21 UTC

This package is not auto-updated.

Last update: 2024-05-12 00:37:46 UTC


README

Single Instance Lock based Redis

Software License Build Status Scrutinizer Code Quality Coverage Status Latest Stable Version Total Downloads Twitter URL

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.