TurnEvent

sealed interface TurnEvent<out A>

One instruction in a TurnSequencer's in-order TurnSequencer.events stream.

A single sealed stream — rather than two parallel flows — so a Reset always arrives in order relative to the Committed actions around it: apply nothing already covered by the reset snapshot, and miss nothing committed before it.

Type Parameters

A

the application action type.

Inheritors

Types

Link copied to clipboard
data class Committed<out A>(val indexed: IndexedAction<A>) : TurnEvent<A>

A committed application action, carrying its assigned log IndexedAction.index and the proposer-stamped IndexedAction.dedupKey. Apply indexed to the game state machine, folding the dedup key through a us.tractat.kuilt.raft.ClientSessionTable to preserve exactly-once.

Link copied to clipboard
data class Reset(val snapshot: Snapshot) : TurnEvent<Nothing>

The state machine must discard its current state and reset to snapshot — Raft installed a compacted snapshot to catch this lagging node up. Rare: only when log compaction is enabled.