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.6.tar.gz
(10.5 kB
view hashes)
Built Distribution
Close
Hashes for redlock_plus-0.1.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ea031f2a75e33c0a8ac436c1b9318e7c09bc0e782a3d8113febd70f3ef035e52 |
|
MD5 | 5ccd5ec3a8b1feb894bb655619e0091c |
|
BLAKE2b-256 | 63b54fdcc9ba84b0af43a5de27b6242f73f156c41e521f1f8d9cee44ee4f8090 |