PendingTransaction
A transactional cache lookup issued via CoreCache.transactionLookupAsync that has not yet resolved.
Constructor
new PendingTransaction()Methods
pending
View sourcepending(): booleanReturns true if the transaction lookup has not yet resolved.
This is a non-blocking check, and can be called any number of times before wait() is
called.
Returns
wait
View sourceWaits for the transaction lookup to resolve, returning a TransactionCacheEntry — the
same value that CoreCache.transactionLookup() would have returned had it been called
instead.
If timeoutMs is provided and the lookup does not resolve within that many milliseconds,
the returned promise rejects, and the pending lookup is released so that it no longer
holds up e.g. other transactional lookups for the same key.
wait() can only be called once per PendingTransaction; calling it again throws.
Parameters
- timeoutMs: numberoptional
The maximum number of milliseconds to wait for the lookup to resolve.
Returns
Throws
- If
timeoutMselapses before the lookup resolves, or ifwait()has already been called on thisPendingTransaction.