toanppp/php-redis-lock
最新稳定版本:1.1.0
Composer 安装命令:
composer require toanppp/php-redis-lock
包简介
Access synchronization mechanism.
README 文档
README
About
Access synchronization mechanism.
Installation
composer require toanppp/php-redis-lock
Methods
RedisLock :: getInstance ( string host, int port )
Create or get singleton instance of RedisLock.
$redisLockInstance = RedisLock::getInstance('127.0.0.1', 6379);
RedisLock :: acquire ( string key, string | null type = null )
Lock a key, with or without type.
$redisLockInstance->acquire('key');
RedisLock :: release ( string key )
Release a key.
$redisLockInstance->release('key');
RedisLock :: releaseByType ( string type )
Release a key by type.
$type = 'uniqueKey'; $redisLockInstance->acquire(uniqid(), $type); $redisLockInstance->releaseByType($type);
统计信息
- 总下载量: 7
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-03-18