React to Events
Telemetry tells you what is true now. Events tell you what just changed. /sim/events is a growing
NDJSON log: one JSON object per line, including situation-change, engine-state, flameout,
docked, undocked, decoupled, and the schedule events.
# Watch everything.tail -f /sim/events
# Stop after the next flameout. grep sees one JSON line at a time.tail -f /sim/events | grep -m1 '"type":"flameout"'# SSE. Each event is a data: line containing the same JSON object.curl -N http://127.0.0.1:4242/v1/eventsUse the event as a wake-up, then read a fresh telemetry document before commanding anything. An event reports the transition, not a magic complete state machine in miniature.
Next, make several writes genuinely simultaneous with Atomic batches.
Next: Atomic batchesCommit a set of same-phase controls in one game tick.