GitHub

TransactionMeta

API reference for TransactionMeta.

The journal and attempt metadata of a running transaction.

attempt counts runs of the outermost body from 1; retry_reason is None on the first. start and now are wall-clock milliseconds since the epoch read from the Clock, as in schedule metadata: start when the transaction began, now when this attempt began.

Attributes

AttributeTypeDescription
journalMapping[TxRef[Any], JournalEntry]
attemptint
retry_reasonTransactionRetryReason | None
startfloat
nowfloat
elapsedfloat

Milliseconds since the first attempt began: now - start, as Effect's.

elapsed_since_previousfloat

Milliseconds since the previous attempt began, as Effect's.

Functions

__init__

__init__(start_ns) -> None
ParameterTypeDescription
start_nsint
def __init__(self, start_ns: int) -> None:
    self._journal: dict[TxRef[Any], JournalEntry] = {}
    self._retry = False
    self._completed = False
    self._attempt = 1
    self._retry_reason: TransactionRetryReason | None = None
    self._start_ns = start_ns
    self._now_ns = start_ns
    self._previous_ns = start_ns