pub struct Ctx {
pub now_rfc3339: String,
pub conn_id: u64,
pub registered_pid: Option<u32>,
pub now_ms: u64,
}Expand description
Context the reducer needs but can’t read from State (clocks, connection identity). Passed in per-call so update remains pure.
Fields§
§now_rfc3339: StringRFC3339 timestamp to stamp on new ProcessRecords. Injected (rather than read from chrono::Utc::now() inside update) to keep the function deterministic for tests.
conn_id: u64The connection on which this command arrived. Currently just used for log correlation; B.4+ will use it to route per-connection replies.
registered_pid: Option<u32>PID the connection has Registered under, if any. The server tracks this server-side and passes it on every command after the initial Register so the reducer can mark the right process Exited on Goodbye. None for the very first command on a connection (which MUST be Register, enforced server- side). (codex P1 + gemini HIGH PR #574 round-1.)
now_ms: u64Phase B.9.1 — monotonic milliseconds since some reference
epoch (the IPC server uses launcher start as the epoch).
Used by the WRR arm for per-window observability timestamps
(last_foreground_at_ms, pending_hwnds[hwnd].arrived_at_ms).
Distinct from now_rfc3339 (wall clock) because operators
reading --diag wrr want age, not absolute time.