The removeAllSlots
removes all slots of the given semaphore.
Returns the slot expiration.
The removeSlot
removes the specified slot.
Returns the slot expiration.
The transaction
method runs the fn
function inside a transaction.
The fn
function is given a IDatabaseSemaphoreTransaction
object.
Note when implementing this method use the strictest transaction level mode.
The updateExpiration
updates the specified slot expiration as long as it is expireable and unexpired of the given semaphore.
Returns a number greater than 0
if the slot expiration was updated, otherwise returns 0
.
The
IDatabaseSemaphoreAdapter
contract defines a way for managing semaphores independent of data storage. This contract simplifies the implementation of semaphore adapters with CRUD-based databases, such as SQL databases and ORMs like TypeOrm and MikroOrm.IMPORT_PATH:
"@daiso-tech/core/semaphore/contracts"