Instance of ResourceLocker to use for acquiring a lock.
Time in ms after which the lock expires.
Creates a Promise that either resolves the given input function or rejects if time runs out,
whichever happens first. The input function can reset the timer by calling the maintainLock
function
it receives. The ResourceIdentifier is only used for logging.
As ReadWriteLocker.withReadLock but the locked function gets called with a maintainLock
callback function
to reset the lock expiration every time it is called.
The resulting promise will reject once the lock expires.
As ReadWriteLocker.withWriteLock but the locked function gets called with a maintainLock
callback function to reset the lock expiration every time it is called.
The resulting promise will reject once the lock expires.
Wraps around an existing ReadWriteLocker and adds expiration logic to prevent locks from getting stuck.