Distributed locks with Redis
Project description
Redlock+ is an up to date, feature complete implementation of the Redlock Algorithm It’s a spiritual successor to glasslion/redlock, which is no longer maintained.
Features
Compliant with the standard library Lock and RLock so it can be used as a drop-in replacement
Complete implementation of the Redlock Algorithm
Autoextend functionality to make redlock safer and easier to use
Well tested (Python 3.6+, PyPy3)
Type hinted
Documentation
Installation
Redlock+ is available on PyPi:
pip install redlock-plus
Basic usage
from redlock_plus import Lock
redis_instance_configs = [
{"url": "redis://localhost/0"},
{"url": "redis://example.com:1234/1"},
{"url": "redis://other.host:5678/2"},
]
with Lock("my_resource", redis_instance_configs):
# do work
or speed up things for repeated use using the factory
from redlock_plus import LockFactory
redlock_factory = LockFactory(
[
{"url": "redis://localhost/0"},
{"url": "redis://localhost/1"},
{"url": "redis://localhost/2"},
]
)
with redlock_factory("my_resource"):
# do work
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
redlock-plus-0.1.5.tar.gz
(10.6 kB
view hashes)
Built Distribution
Close
Hashes for redlock_plus-0.1.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c6b37c0d0da732cfa1fa801fe19cf13891df2e3082bd98e497bf54be31b08bb5 |
|
MD5 | fa1d8364ac707df332ff03a987ffe710 |
|
BLAKE2b-256 | ea836ea46c21744a72e3a907121ead9080319667b9d9b37836b6aa883e619a4c |