Skip to main content

Module checkpoint

Module checkpoint 

Source
Expand description

Checkpoint management for resumable sessions.

Checkpoints are held in memory. They support replay and resume within a process; they do not survive process loss, so a new process cannot resume a session started by another. “Atomic” below means a single assignment under a lock, not a transaction with a persistent store.

The CheckpointManager provides atomic checkpoint persistence so that a crash cannot leave an event emitted but un-checkpointed (or vice versa). For the initial implementation, storage is in-memory (Vec<SessionEvent>). The real integration with SessionService for persistent storage is a platform concern.

§Responsibilities

  1. Atomicity guarantee: event + state saved together in one operation
  2. Load/resume interface: retrieve all events and last run state
  3. Event log maintenance: ordered log for replay

Structs§

CheckpointManager
Manages in-process checkpoint state for resumable sessions.
RunState
Run-state persisted with each checkpoint.