glocks
glocks
is a set of global locks that use redis to register the
locked resource. Variants of the simple (non-reentrant) global lock
include reentrant, distrubed and reentrant-distributed locks.
Based on redlock but introduces reentrant locks with the option of "staying alive".
Installation
pip install glocks
Usage
from glocks import Lock
with Lock({'host': 'localhost', 'port': 6379, 'db': 5}, 'myresource', 500):
# do thing that would have suffered from multitenancy race conditions
...
# continue on with life
Change Log
- Bare bones project initiated [27th April 2016]
To Do
- make the context manager thread safe
- make the initialization of the lock thread safe
- write docstrings on classes and methods