Skip to content

Function: withAdvisoryLock()

withAdvisoryLock<T>(pool, key, fn): Promise<T>

Hold a session advisory lock for the duration of fn.

The callback receives the dedicated PoolClient that owns the lock. Use it for any operation that must be protected by the lock.

T

PgPoolLike

unknown

(client) => T | Promise<T>

Promise<T>