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.
Identifier of the resource that needs to be locked.
A function to execute while the resource is locked.
A promise resolving when the lock is released.
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.
Identifier of the resource that needs to be locked.
A function to execute while the resource is locked.
A promise resolving when the lock is released.
Allows the locking of resources which is needed for non-atomic ResourceStores.