Creates a middleware factory that wraps function calls with a distributed
lock.
Before executing the wrapped function a lock is acquired on the derived key.
If another process already holds the lock the call waits (or fails
immediately for non-blocking locks) until the lock is released.
Creates a middleware factory that wraps function calls with a distributed lock.
Before executing the wrapped function a lock is acquired on the derived key. If another process already holds the lock the call waits (or fails immediately for non-blocking locks) until the lock is released.