Download the PHP package neovg/phpredis-lock without Composer
On this page you can find all versions of the php package neovg/phpredis-lock. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download neovg/phpredis-lock
More information about neovg/phpredis-lock
Files in neovg/phpredis-lock
Download neovg/phpredis-lock
More information about neovg/phpredis-lock
Files in neovg/phpredis-lock
Vendor neovg
Package phpredis-lock
Short Description Simple mutex locking class with support for TTL using PHPRedis as backend.
License BSD-3-Clause
Homepage https://github.com/NeoVG/phpredis-lock
Package phpredis-lock
Short Description Simple mutex locking class with support for TTL using PHPRedis as backend.
License BSD-3-Clause
Homepage https://github.com/NeoVG/phpredis-lock
Please rate this library. Is it a good library?
Informations about the package phpredis-lock
phpredis-lock
Simple mutex locking class with support for TTL using PHPRedis as backend.
Installation
composer require neovg/phpredis-lock
Setup
\NeoVg\PhpRedisLock\Lock::getInstance()->setConfig(
(new \NeoVg\PhpRedisLock\ConfigStruct())
->withHost('127.0.0.1')
->withPort(6379)
->withDatabase(11)
);
Usage
Acquire and release
if (!\NeoVg\PhpRedisLock\Lock::getInstance()->acquire('name')) {
echo 'could not acquire lock';
}
if (!\NeoVg\PhpRedisLock\Lock::getInstance()->release('name')) {
echo 'could not release lock';
}
Non blocking acquire
\NeoVg\PhpRedisLock\Lock::getInstance()->acquire('name', 0);
Custom wait time (120 seconds)
\NeoVg\PhpRedisLock\Lock::getInstance()->acquire('name', 120);
TTL (60 seconds)
\NeoVg\PhpRedisLock\Lock::getInstance()->acquire('name', null, 60);
Check if already acquired (by this process)
\NeoVg\PhpRedisLock\Lock::getInstance()->isAcquired('name');
Check if already locked (by another process)
\NeoVg\PhpRedisLock\Lock::getInstance()->isLocked('name');
Get info about existing lock
$lockInfo = \NeoVg\PhpRedisLock\Lock::getInstance()->get('name;);
All versions of phpredis-lock with dependencies
PHP Build Version
Package Version
Requires
php Version
>=7.4
ext-redis Version *
ext-json Version *
florianwolters/component-util-singleton Version 0.3.*
neovg/php-struct Version ^1.4
cakephp/chronos Version ^1.0 || ^2.0
ext-redis Version *
ext-json Version *
florianwolters/component-util-singleton Version 0.3.*
neovg/php-struct Version ^1.4
cakephp/chronos Version ^1.0 || ^2.0
The package neovg/phpredis-lock contains the following files
Loading the files please wait ....