Declaraciones públicas de media-daemon/ipc/signals_publisher.zig (media-daemon: señales de transporte (evt)).
apps/docs/generated/zig/media-daemon-ipc-signals.jsonPágina generada desde
native/zig/media-daemon/ipc/signals_publisher.zig. No se edita a mano:bun run docs:genla regenera ybun run docs:checkfalla si difiere.
Transport signals of the data plane → evt.media.transportSignals on NATS
(dec-0120). The daemon publishes them itself with spire-zig, signed with
its identity; realtime-svc consumes them (its route admits media-daemon
only). Before: an IPC broadcast to playback-svc, which re-published them —
a relay with no decision in it, gone.
NATS core, not JetStream: a snapshot is an observation (latest-wins), not
a fact to replay. While NATS is down the publisher drops samples and
reconnects with backoff (ResilientPublisher); the data plane never waits
on it.
payloadOffn · línea 22
pub fn payloadOf(snap: transport_signals.TransportSnapshot, ts_ms: i64) ?contracts.MediaTransportSignalsRequestThe contract payload of a sample, or null if it cannot be sent as-is (a version 0 is pre-init; a non-finite loss rate is not a measurement).
runfn · línea 37
pub fn run( signals: *transport_signals.TransportSignalsChannel, publisher: *spire.transport.nats.ResilientPublisher, running: *const std.atomic.Value(bool), interval_ms: u64, ) voidPoller thread: every interval_ms, the newest sample (if any) goes out.
Latest-wins: several publishes between two polls collapse into one.
parseNatsUrlfn · línea 63
pub fn parseNatsUrl(url: []const u8) error{InvalidNatsUrl}!struct { host: []const u8, port: u16 }nats://host:port (the same NATS_URL the services read). The scheme is
optional; the port defaults to 4222.