Creates a middleware factory that wraps function calls with a distributed
semaphore.
Before executing the wrapped function a slot is acquired on the derived
key. If the maximum number of concurrent slots (limit) has already been
reached the call waits (or fails immediately for non-blocking semaphores)
until a slot becomes available.
Creates a middleware factory that wraps function calls with a distributed semaphore.
Before executing the wrapped function a slot is acquired on the derived key. If the maximum number of concurrent slots (
limit) has already been reached the call waits (or fails immediately for non-blocking semaphores) until a slot becomes available.