An async function that waits to acquire the lock, then provides a function to unlock. Use like: const unlockingFunction = await promiseChainLock.acquireLock(); try { // Do some stuff. } finally { unlockingFunction(); }
a promise that resolves when the lock has been acquired, resolving to a cb to unlock it.
An async function that waits to acquire the lock, then provides a function to unlock. Use like: const unlockingFunction = await promiseChainLock.acquireLock(); try { // Do some stuff. } finally { unlockingFunction(); }