Skip to main content

Module replay

Module replay 

Source
Expand description

Deterministic-replay harness.

  • Record mode: every Record(JournalEntry) is appended to the in-memory journal.
  • Replay mode: the harness ignores fresh Record events and instead exposes the previously-loaded journal via Replay { sink, reply }. The harness pulls each entry off the snapshot and tells sink to handle it. The sink is user-supplied so it can dispatch into the live actor system.
  • Off mode: drop everything.

Storage is an in-memory Vec<JournalEntry> by default. With the replay cargo feature enabled, ReplayHarness::with_journal attaches a [atomr_persistence::Journal] backend (e.g. the in-memory InMemoryJournal from atomr-persistence-query-inmemory for tests, or an SQL/Redis provider in production). When attached, every Record round-trips through the journal as a [PersistentRepr] and LoadFromJournal pulls history back as JournalEntrys.

Structs§

ReplayHarness

Enums§

JournalEntry
ReplayMode
ReplayMsg

Traits§

ReplaySink
Trait the user implements to consume replayed entries. The actor receives one OnEntry { entry } message per replay event; the reply lets the harness pace the replay (next entry waits for the sink’s reply).

Functions§

replay_via_sink
Convenience type-erased wrapper that bridges the typed ReplaySink trait to a closure-based replay_all call.