SherlockPython 分布式锁
Sherlock 是一个易用的 Python 分布式进程内锁机制库,你可选择锁同步的不同后台。
示例代码:
import sherlock from sherlock import Lock # Configure Sherlock's locks to use Redis as the backend, # never expire locks and retry acquiring an acquired lock after an # interval of 0.1 second. sherlock.configure(backend=sherlock.backends.REDIS, expire=None, retry_interval=0.1) # Note: configuring sherlock to use a backend does not limit you # another backend at the same time. You can import backend specific locks # like RedisLock, MCLock and EtcdLock and use them just the same way you # use a generic lock (see below). In fact, the generic Lock provided by # sherlock is just a proxy that uses these specific locks under the hood. # acquire a lock called my_lock lock = Lock('my_lock') # acquire a blocking lock lock.acquire() # check if the lock has been acquired or not lock.locked() == True # release the lock lock.release()
评论
spring-boot-lock-starterRedis 分布式锁
基于redis的分布式锁spring-boot starter组件,使得项目拥有分布式锁能力变得异常
spring-boot-lock-starterRedis 分布式锁
0
spring-boot-lock-starterRedis 分布式锁
基于redis的分布式锁spring-bootstarter组件,使得项目拥有分布式锁能力变得异常简单,支持springboot,和spirngmvc等spring相关项目快速开始springboot
spring-boot-lock-starterRedis 分布式锁
0
RedLock分布式锁
RedLock是一个使用Python和Redis实现的分布式锁。实现了来自 @antirez 的 RedLock算法。示例代码:from redlock import RedLock# By defa
RedLock分布式锁
0