cadrumo.application.operations.persistence.replay module

Application-owned bounded operation-event replay contracts.

class OperationReplayStatus(*values)[source]

Bases: StrEnum

Outcome category for one bounded event replay request.

PAGE
CAUGHT_UP
EXPIRED
COMPACTED
UNKNOWN_OPERATION
RESYNCHRONIZING_REPLAY_STATUSES: frozenset[OperationReplayStatus]

Replay statuses meaning the consumer cannot continue incrementally and must resynchronize from an authoritative restart cursor rather than the requested one. Every other status (PAGE, CAUGHT_UP, and, at the adapter boundary, UNKNOWN_OPERATION) can be followed from the requested cursor; a status in this set cannot.

class OperationReplayPage(**data)[source]

Bases: BaseModel

Authoritative bounded replay result and next exclusive cursor.

Parameters:

data (Any)

status: OperationReplayStatus
requested_cursor: OperationEventCursor
events: tuple[OperationEvent, ...]
next_cursor: OperationEventCursor
restart_cursor: OperationEventCursor | None