dflockd-client¶
A Python client for dflockd — a distributed FIFO lock and counting-semaphore server.
Features¶
- Sync and async clients with the same API surface
- Distributed locks and counting semaphores with FIFO ordering
- Single-phase
acquireand two-phaseenqueue+wait - Background lease renewal so you can hold a lock as long as the work takes
- Multi-server sharding (CRC-32; cross-language compatible)
- TLS and shared-secret authentication
- Zero runtime dependencies; Python 3.12+
At a glance¶
from dflockd_client import SyncDistributedLock
with SyncDistributedLock("my-key") as lock:
# critical section — lease auto-renews in the background
print(f"acquired: {lock.token}")
from dflockd_client import SyncDistributedSemaphore
with SyncDistributedSemaphore("pool", limit=3) as sem:
# up to 3 holders at once
...
Where to go next¶
- Installation — pip / uv
- Quick Start — first lock and semaphore
- Examples — FIFO ordering, two-phase, auth, TLS, sharding
- Sync Client / Async Client — full method reference
- Architecture — how it works internally
- Sharding — routing keys across servers
- API Reference — every public symbol