Skip to main content

remote_frame

Function remote_frame 

Source
pub fn remote_frame(session_id: &str) -> String
Expand description

remote.frame.<session_id> — agent → backend, one encoded tile per message.

Session-scoped rather than pc-scoped so two operators viewing the same machine never have to demultiplex each other, and so a torn-down session’s late frames land on a subject nobody reads any more.

Core NATS only — deliberately not JetStream. A frame is worthless the moment it has been displayed; retaining megabytes per second of them would cost storage and add latency for nothing. remote.* sits outside the events.> / obs.> / commands.* filters precisely so no stream catches it — the same reasoning NOTIFICATIONS_AMEND_SUBJECT records.

The payload is the raw encoded image, not JSON: tile metadata rides in NATS headers (see crate::wire::FrameMeta). Base64 inside a JSON envelope inflates every frame by a third, and #1142 measured a typical session at ~4.0 Mbps — so the envelope alone would cost ~1.3 Mbps per viewer to carry nothing.