Retrieves the reader semaphore configuration (limit) for a given key.
Readable execution context for the operation
The shared lock identifier
Semaphore config with limit, or null if not found
Retrieves all reader slots for a given shared lock. Returns empty array if no readers or shared lock doesn't exist. Includes expired slots until they are explicitly removed.
Readable execution context for the operation
The shared lock identifier
Array of reader slot data with IDs and expirations
Removes all reader slots for a given shared lock. Used for cleanup or reset operations.
Readable execution context for the operation
The shared lock identifier
Array of expiration data for all removed slots
Removes a specific reader slot, releasing it for other readers.
Readable execution context for the operation
The shared lock identifier
The reader slot identifier to remove
Expiration data of the removed slot, or null if not found
Extends a reader slot's expiration if it hasn't expired yet. Heartbeat/keep-alive mechanism for long-running readers.
Readable execution context for the operation
The shared lock identifier
The reader slot identifier to extend
New expiration time
Number > 0 if updated, 0 if slot not found or already expired
Creates or updates the reader semaphore configuration. Sets the maximum number of concurrent readers allowed.
Readable execution context for the operation
The shared lock identifier
Maximum concurrent reader slots
Creates or updates a reader slot within the semaphore. Called when a reader acquires a slot.
Readable execution context for the operation
The shared lock identifier
Unique identifier for this reader slot
When the slot expires, or null for indefinite
Transaction context for reader (shared) semaphore operations. Provides methods to manage reader slots within a database transaction.
Reader semaphores allow multiple concurrent readers (up to limit). Each reader occupies a "slot" identified by a unique slot ID.
IMPORT_PATH:
"@daiso-tech/core/shared-lock/contracts"