Configuring SharedLock adapters
MemorySharedLockAdapter
MemorySharedLockAdapter
Implementing your custom ISharedLockAdapter
The SharedLock middleware wraps function calls with a distributed shared lock (reader-writer lock), providing concurrency control with two access modes: Reader mode ("READER") allows multiple callers to execute the wrapped function concurrently as long as no writer holds the lock, while Writer mode ("WRITER") grants exclusive access. Before executing the wrapped function, the appropriate lock is acquired on a key derived from the function's arguments.
withSharedLockPrefix plugin
The eridu-tech/shared-lock component provides a way for managing shared-locks (a.k.a reader writer locks) independent of underlying platform or storage.
The SharedLockFactoryResolver class provides a flexible way to configure and switch between different shared-lock adapters at runtime.