Download the PHP package cognizo/redis-mutex without Composer
On this page you can find all versions of the php package cognizo/redis-mutex. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download cognizo/redis-mutex
More information about cognizo/redis-mutex
Files in cognizo/redis-mutex
Download cognizo/redis-mutex
More information about cognizo/redis-mutex
Files in cognizo/redis-mutex
Vendor cognizo
Package redis-mutex
Short Description A simple Redis-backed mutex lock.
License MIT
Homepage https://github.com/cognizo/redis-mutex
Package redis-mutex
Short Description A simple Redis-backed mutex lock.
License MIT
Homepage https://github.com/cognizo/redis-mutex
Please rate this library. Is it a good library?
Informations about the package redis-mutex
RedisMutex
RedisMutex is a simple Redis-backed distributed mutex for PHP.
Basic Usage
<?php
use Cognizo\RedisMutex\Lock;
if (Lock::get('myLock'))
{
// Do something exclusively
Lock::release('myLock');
}
else
{
echo "Couldn't get exclusive lock!";
}
You can also wait for a lock to be released:
// Wait up to 30 seconds for 'myLock' to become available
Lock::get('myLock', 30);
Specifying the Redis connection:
define('REDIS_PATH', 'tcp://127.0.0.1:6379');
// Or
define('REDIS_HOST', '127.0.0.1');
define('REDIS_PORT', 6379);
Install
Install the cognizo/redis-mutex package with Composer.
All versions of redis-mutex with dependencies
PHP Build Version
Package Version
The package cognizo/redis-mutex contains the following files
Loading the files please wait ....