IMQLock.acquire() method

Acquires a lock for a given key.

Signature:

static acquire<T>(key: string, callback?: (...args: any[]) => any, metadata?: IMQLockMetadataItem): Promise<AcquiredLock<T>>;

Parameters

Parameter

Type

Description

key

string

key to acquire the lock for

callback

(...args: any[]) => any

(Optional) callback invoked on lock resolution

metadata

IMQLockMetadataItem

(Optional) metadata for the locked call

Returns:

Promise<AcquiredLock<T>>

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