Expand description
Event consumers for the cascade event protocol.
Three sinks, all implementing EventSink:
JsonlWriter— streams events as JSONL to anyWrite + SendEventCollector— accumulates events into aVecfor batch use / testsSnapshotAccumulator— folds events into a cascade-tree view wired intotree.rs’sTreeNodetrait
Plus render_events — same event slice, four output formats.
Structs§
- Delay
Sink - Wraps an
EventSinkand injects a wall-time sleep after eachRoundCompletedevent. Useful for making the deterministic sim watchable in live mode — without this the cascade fires in microseconds, faster than the live renderer’s frames can register to a human eye. - Delaying
Executor - Wraps a
consortium_nix::cascade::RoundExecutorand sleeps for a configurable duration insidedispatch. Critical for live demos: without this, the deterministic sim resolves a round in microseconds and the live renderer’s “spinning” frame (rendered at PlanComputed) is invisible because EdgeCompleted fires before the human eye can register it. - Event
Collector - Accumulates all events into a
Vec<CascadeEvent>for batch processing. Useful for tests and for feedingrender_eventsafter a run. - Jsonl
Writer - Streams events as JSONL (one JSON object per line) to any
Write + Send. - Live
Tree Renderer - EventSink that re-renders the cascade tree to stdout in place every
RoundCompleted(andFinished). Uses ANSI cursor positioning so the tree fills in line-by-line as the cascade unfolds — same idiom nix-output-monitor (nom) uses. - Owned
Tree Node - A self-contained tree node that owns its children. Implements
TreeNodeso it can be handed directly totree::render. - Snapshot
Accumulator - Folds
CascadeEvents into per-node snapshots that can be rendered as a cascade tree.
Enums§
- Sink
Kind - Which event sink a run should wire, decided before any node is contacted.
Functions§
- render_
events - Render a slice of
CascadeEvents in the requestedOutputFormat. - sink_
for_ format - Pick the event sink for an output format.