InMemoryLease
Defined in: src/coordination/leases/InMemoryLease.ts:53
Reference Lease implementation backed by the shared in-memory store.
Useful for tests and single-process development. The store is a plain
JS Map, so it is NOT appropriate for multi-process deployments — use
KubernetesLease for that.
Implements
Section titled “Implements”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new InMemoryLease(
settings):InMemoryLease
Defined in: src/coordination/leases/InMemoryLease.ts:59
Parameters
Section titled “Parameters”settings
Section titled “settings”Returns
Section titled “Returns”InMemoryLease
Methods
Section titled “Methods”acquire()
Section titled “acquire()”acquire():
Promise<boolean>
Defined in: src/coordination/leases/InMemoryLease.ts:63
Try to acquire the lease. Resolves true on success, false on contention.
Returns
Section titled “Returns”Promise<boolean>
Implementation of
Section titled “Implementation of”checkAlive()
Section titled “checkAlive()”checkAlive():
boolean
Defined in: src/coordination/leases/InMemoryLease.ts:85
True if this process currently owns the lease. Purely local — no IO.
Returns
Section titled “Returns”boolean
Implementation of
Section titled “Implementation of”onLost()
Section titled “onLost()”onLost(
handler): () =>void
Defined in: src/coordination/leases/InMemoryLease.ts:87
Register a handler fired when ownership is lost unexpectedly.
Parameters
Section titled “Parameters”handler
Section titled “handler”(reason) => void
Returns
Section titled “Returns”() => void
Implementation of
Section titled “Implementation of”release()
Section titled “release()”release():
Promise<void>
Defined in: src/coordination/leases/InMemoryLease.ts:78
Release the lease voluntarily. No-op if not held.
Returns
Section titled “Returns”Promise<void>