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
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.4.tar.gz
(10.3 kB
view hashes)
Built Distribution
Close
Hashes for redlock_plus-0.1.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 27a6c238330b32d7b879e54c02539f15ded261b20fa10f62e46cb709fb2cff43 |
|
MD5 | d3dc7ed04ba8fc7e6ccbcd6a68dc6084 |
|
BLAKE2b-256 | 6eba595e39e9af5f31be4ac19f702d31ecb87d9d685f28750bf46f0ad0750aeb |