--- id: aioredlock version: "0.7.3" license: MIT license_treatment: permissive maintenance: dormant --- # aioredlock — Asyncio implemetation of Redis distributed locks License: permissive · Maintenance: dormant · Downloads: 103.4K/mo ## What it is and what it does Aioredlock is an asyncio-compatible implementation of the Redlock distributed locking algorithm for Redis. It allows async Python applications to safely coordinate access to shared resources across multiple Redis instances, ensuring that only one client holds a lock at a time even in the presence of network partitions or clock skew. The package provides a lock manager that can acquire, extend, and release locks with configurable timeouts and retry behavior. It supports multiple Redis connection types (tuples, dicts, URIs, and Sentinel), and locks can be used directly or as async context managers. The implementation requires at least half of the configured Redis instances to agree on lock state for operations to succeed, following the Redlock consensus model. Use it for: - Coordinate task execution across multiple async workers to prevent duplicate processing of the same job. - Protect shared resource updates in a distributed system where multiple services need exclusive access. - Implement leader election or distributed consensus primitives in microservices architectures. - Prevent concurrent writes to a shared data store when using multiple async application instances. - Gate access to rate-limited external APIs or services from multiple concurrent async clients. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Implements the Redlock distributed lock algorithm for asyncio, enabling safe resource coordination across multiple Redis instances in async Python applications. Yes, but with caution. The package is stable and production-ready (MIT license, no known vulnerabilities, low install friction), but it has been dormant since February 2022. Install it if you need Redlock for asyncio and can accept that no active maintenance is happening; verify that aioredis itself is still viable for your target Python and Redis versions before committing. ## Install pip install aioredlock uv add aioredlock poetry add aioredlock ## Installing aioredlock Before you install: Low friction install with just two runtime dependencies (aioredis and attrs). Package is dormant—last release was 2022-02-08, over 1648 days ago—so expect no active maintenance or updates. License in practice: MIT license (permissive) means you can use, modify, and distribute this package freely with minimal restrictions, though you must include the license notice. Quickstart: pip install aioredlock from aioredlock import Aioredlock, LockError lock_manager = Aioredlock([('localhost', 6379)]) lock = await lock_manager.lock('resource_name', lock_timeout=10) await lock_manager.unlock(lock) await lock_manager.destroy() Requires a running Redis instance; aioredis must be able to connect to at least one Redis server for lock operations to succeed. Verify before relying: - Whether aioredis dependency is compatible with modern Python 3.9+ async patterns and current Redis versions. - Whether the package works reliably with Redis Cluster or only standalone/Sentinel deployments. - Current state of aioredis itself—if it is also dormant or deprecated, aioredlock's viability is further limited. ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: dormant - Downloads: 103.4K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags redis distributed locks asyncio, redlock algorithm python async, multi-redis lock manager, asyncio redis locking, distributed lock redis, async resource coordination, redis, distributed-locks, asyncio [View on SkillFed](https://skillfed.io/packages/aioredlock) · [View on PyPI](https://pypi.org/project/aioredlock/)