Executes a function within a database transaction providing both reader and writer operations. Ensures atomicity of all shared lock operations within the transaction.
Implementations must use the strictest transaction isolation level available to prevent race conditions between concurrent readers and writers.
Readable execution context for the operation
Async function receiving combined reader/writer transaction object
The value returned by the transaction function
Database adapter contract for implementing shared (reader-writer) locks in SQL/document databases. Simplifies shared lock implementation using transactional CRUD patterns.
Shared locks implement the reader-writer pattern:
Designed for persistent shared locks stored in databases like:
Key design:
IMPORT_PATH:
"@daiso-tech/core/shared-lock/contracts"