event static method
Reports one event on channel. Fire-and-forget and safe everywhere:
when the inspector is inert this is a null check and a return.
details is for the heavy parts — headers, bodies — held server-side
in a byte-capped store and fetched only when an attacher asks
(meta/detail). The event itself stays small, so the
hot path and the ring never carry a body. The details are not free,
though: they are JSON-encoded as the event is reported, whether or not
anyone ever asks — only their delivery waits.
Implementation
static void event(
String channel,
Map<String, Object?> payload, {
Map<String, Object?>? details,
}) {
var step = Zone.current[stepKey];
_active?.addEvent(
channel,
step == null || payload.containsKey('step')
? payload
: {...payload, 'step': '$step'},
rid: _rid(),
details: details,
);
}