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.
Run the given function while the resource is locked. The lock will be released when the (async) input function resolves. This function should be used for operations that only require reading the resource.
Run the given function while the resource is locked. The lock will be released when the (async) input function resolves. This function should be used for operations that could modify the resource.
Wraps around an existing ReadWriteLocker and adds expiration logic to prevent locks from getting stuck.