@openknot-ts/redis-lock
v0.0.6-preview
Published
Redis implementation of the OpenKnot lock contract over a consumer-owned client.
Readme
@openknot-ts/redis-lock
Implements the lock contract over a node-redis client the application already manages.
import { redisLock } from "@openknot-ts/redis-lock/wire";
export const lock = redisLock({ requirements: { redis }, commands: ({ redis }) => redis.commands, prefix: "app:lock" });- Acquisition is
SET key token NX PX lease; release deletes the key only for the same token. The native expiry bounds a crashed holder; nothing renews or polls. prefixis a string or(dependencies) => string, so separate locks can use their own validated config.
pnpm --filter @openknot-ts/redis-lock test:redis runs the integration tests against REDIS_URL.
