A resource locker making use of the
Note that all locks are kept in memory until they are unlocked which could potentially result
in a memory leak if locks are never unlocked, so make sure this is covered with expiring locks for example,
Acquires a lock on the requested identifier. The promise will resolve when the lock has been acquired.
Resource to acquire a lock on.
Counts the number of active locks.
Releases a lock on the requested identifier. The promise will resolve when the lock has been released. In case there is no lock on the resource an error should be thrown.
Resource to release the lock on.