Skip to main content

Module event_render

Module event_render 

Source
Expand description

Event consumers for the cascade event protocol.

Three sinks, all implementing EventSink:

Plus render_events — same event slice, four output formats.

Structs§

DelaySink
Wraps an EventSink and injects a wall-time sleep after each RoundCompleted event. 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.
DelayingExecutor
Wraps a consortium_nix::cascade::RoundExecutor and sleeps for a configurable duration inside dispatch. 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.
EventCollector
Accumulates all events into a Vec<CascadeEvent> for batch processing. Useful for tests and for feeding render_events after a run.
JsonlWriter
Streams events as JSONL (one JSON object per line) to any Write + Send.
LiveTreeRenderer
EventSink that re-renders the cascade tree to stdout in place every RoundCompleted (and Finished). Uses ANSI cursor positioning so the tree fills in line-by-line as the cascade unfolds — same idiom nix-output-monitor (nom) uses.
OwnedTreeNode
A self-contained tree node that owns its children. Implements TreeNode so it can be handed directly to tree::render.
SnapshotAccumulator
Folds CascadeEvents into per-node snapshots that can be rendered as a cascade tree.

Enums§

SinkKind
Which event sink a run should wire, decided before any node is contacted.

Functions§

render_events
Render a slice of CascadeEvents in the requested OutputFormat.
sink_for_format
Pick the event sink for an output format.