Configuring Semaphore adapters
MemorySemaphoreAdapter
MemorySemaphoreAdapter
Implementing your custom ISemaphoreAdapter
The Semaphore middleware wraps function calls with a distributed semaphore, limiting the number of concurrent executions across processes. Before executing the wrapped function, a slot is acquired on a key derived from the function's arguments. 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.
withSemaphorePrefix plugin
The eridu-tech/semaphore component provides a way for managing semaphores independent of underlying platform or storage.
The SemaphoreFactoryResolver class provides a flexible way to configure and switch between different semaphore adapters at runtime.