AnyLock interface

Lock implementation interface to follow

Signature:

export interface AnyLock 

Methods

Method

Description

acquire()

Implements lock acquire logic asynchronously

destroy()

Implements lock safe destruction asynchronously

dispose()

Must free all local resources held by the lock (timers, client event listeners, registry entries) without any database communication. Used when the underlying connection is already gone.

init()

Must initialize lock asynchronously

isAcquired()

Implements lock acquire verification asynchronously

onAcquire(handler)

Implements late lock acquire handler upset. The handler is called when the lock gets taken over by a retry, long after the acquire() caller has given up - which makes it the only chance for that caller to finish whatever the lock was being acquired for.

onRelease(handler)

Implements lock release handler upset

release()

Implements lock release logic asynchronously

Read this page as plain markdown — no HTML, no navigation. For pasting into an LLM, or for an agent to fetch.