Skip to main content
Defined in: coordination/lease.ts:46 A fenced, expiring lease per key. Implementations must make each call atomic:
  • acquire grants the key when it is free or expired (a new, larger token), or extends it when owner already holds it (same token); else returns null.
  • renew extends the lease only when owner still holds it with token.
  • release frees the key only when owner holds it with token (else no-op). Tokens never go backwards for a key, even across release and expiry.

Methods

acquire()

Defined in: coordination/lease.ts:47

Parameters

Returns

Promise<LeaseGrant | null>

renew()

Defined in: coordination/lease.ts:48

Parameters

Returns

Promise<boolean>

release()

Defined in: coordination/lease.ts:49

Parameters

Returns

Promise<void>