Expand description
Live match-trace channel — RFC 006 (in-process) + RFC 009 (transport).
§Architecture
HTTP handler ──► TraceEmitter::emit()
│
tokio::sync::broadcast (bounded, 1024)
│
┌─────────────┴──────────────┐
in-process TraceTransport::accept_loop
subscriber (UDS on Unix, TCP fallback)
│
up to 4 GUI connections
(newline-delimited JSON)§Transport variants
TraceTransportConfig | Platform | Notes |
|---|---|---|
Uds { path } | Unix/macOS | Default when available |
Tcp { addr } | All | Portable fallback; addr = "127.0.0.1:0" assigns ephemeral port |
Disabled | All | No out-of-process forwarding (default) |
§Back-pressure
The broadcast channel is bounded by TRACE_CHANNEL_CAPACITY. When
the channel is full, emit drops the event and increments an internal
counter; the count is reported as dropped_count on the next event.
Slow out-of-process subscribers receive a RecvError::Lagged from the
broadcast channel; the gap is reported in the next JSON line via
dropped_count.
§Subscriber cap
At most MAX_SUBSCRIBERS out-of-process connections are accepted.
A fifth connection receives {"error":"max_subscribers_reached"} and
is then closed.
Structs§
- Match
Trace Event - A single request/response trace event.
- Request
Summary - Key fields from the incoming HTTP request.
- Trace
Emitter - Shared handle to the trace broadcast channel.
- Trace
Transport
Enums§
- Outcome
- What the server decided to do with the request.
- Trace
Transport Config - Configuration for the out-of-process transport layer.
Constants§
- MAX_
SUBSCRIBERS - Maximum concurrent out-of-process subscriber connections.
- TRACE_
CHANNEL_ CAPACITY - Capacity of the broadcast channel (events).
Functions§
- now_ms
- Current Unix time in milliseconds.