Class

SynchronousLock

SynchronousLock(counteropt, onBeginopt, onEndopt)

Constructor

# new SynchronousLock(counteropt, onBeginopt, onEndopt)

Simple Synchronous Lock implementation

Parameters:
Name Type Attributes Description
counter number <optional>

the number of simultaneous transactions allowed. defaults to 1

onBegin function <optional>

to be called at the start of the transaction

onEnd function <optional>

to be called at the conclusion of the transaction

Implements:

View Source locks/SynchronousLock.ts, line 5

Members

Transaction.<any>

# currentTransaction Optional

Stores a reference to the currently executing transaction, allowing access to the active transaction context

Current active transaction reference

Implements:

View Source interfaces/TransactionLock.ts, line 12

Methods

# async release(erropt) → {Promise.<void>}

Releases The lock after the conclusion of a transaction

Parameters:
Name Type Attributes Description
err Error <optional>
Implements:

View Source locks/SynchronousLock.ts, line 167

Promise.<void>

# async submit(transaction) → {Promise.<R>}

Submits a transaction to be processed

Parameters:
Name Type Description
transaction Transaction
Implements:

View Source locks/SynchronousLock.ts, line 148

Promise.<R>