dflockd-client
v1.11.0
Published
TypeScript client for the dflockd distributed lock daemon
Maintainers
Readme
dflockd-client
TypeScript client for the dflockd distributed lock daemon.
Install
npm install dflockd-clientQuick example
import { DistributedLock } from "dflockd-client";
const lock = new DistributedLock({ key: "my-resource" });
await lock.withLock(async () => {
// critical section — lock is held here
});
// lock is releasedFeatures
- Locks and semaphores with automatic lease renewal
- Two-phase locking — enqueue then wait, with hooks between steps
- Signal pub/sub — NATS-style pattern matching and queue groups
- Multi-server sharding — CRC32-based consistent hashing
- TLS and authentication support
- Low-level API for direct socket control
Documentation
Full docs at mtingers.github.io/dflockd-client-ts
License
MIT
