glocks

global-locks or ``glocks`` is a set of locks that use redis to register the locked resource. Variants of the simple (non-reentrant) global lock include reentrant, distrubed and reentrant-distributed locks.


Keywords
glocks, global, locks, lock, reentrant, distributed, redis, twisted
License
Other
Install
pip install glocks==0.0.0

Documentation

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

  1. make the context manager thread safe
  2. make the initialization of the lock thread safe
  3. write docstrings on classes and methods