pub enum HostFrame {
Event(Event),
Command(Command),
}Expand description
Phase CPD-1 (cross-process dispatch) — envelope enum for frames
sent over the launcher → host pipe direction. Today the host’s
read loop only expects Event JSON; CPD-2 extends the read loop
to recognize this tagged union and dispatch by kind:
event→ existing event-handling code (state sync from launcher reducer broadcasts).command→ new command-handling code (saga-issued actions).
Newline-delimited JSON, one frame per line. #[serde(tag = "kind", rename_all = "snake_case")] so the wire shape is e.g.
{"kind":"event","event":"pool_window_added",...} or
{"kind":"command","cmd":"spawn_pool_window","saga_id":42}.
Schema-only in CPD-1: introduced now so the launcher’s host-pipe writer (CPD-2) and the host’s read loop (CPD-2/CPD-3) can be built against a stable wire envelope without further schema churn.
Variants§
Event(Event)
Wraps a launcher-emitted Event being pushed down to the host (existing fanout path; CPD-2 refactors the writer to go through this envelope).
Command(Command)
Wraps a saga-issued Command being dispatched from the launcher
to the host. Carries saga_id inside the Command payload.