Skip to content

PHP使用Redis实现分布式锁,结合lua实现Redis命令原子性

Notifications You must be signed in to change notification settings

JimmyZzzzz/redisLock

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

redisLock

PHP使用Redis实现分布式锁,结合lua实现Redis命令原子性

$redisLock = new redisLock(IP,PORT,AUTH);

返回redis实例 redisLock->redis_instance();

获取锁: $lock_name 锁名 , $acquire_time 重复请求次数 , $lock_timeout 请求超时时间 单位s redisLock->acquire_lock($lock_name, $acquire_time = 3, $lock_timeout = 10)

释放锁: $lock_name 锁名 , $identifier 获取锁 返回的标识; redisLock->release_lock($lock_name, $identifier);

About

PHP使用Redis实现分布式锁,结合lua实现Redis命令原子性

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages