PATTERN Cited by 1 source
Publish before subscribe¶
Problem¶
In a relay-mediated pub/sub system, the first subscription must travel through the relay chain to the publisher before the publisher starts sending. This adds latency for the first viewer — they must wait for the round-trip to the publisher before receiving any data.
Solution¶
A PUBLISH primitive lets a publisher send a track to a relay proactively, before any viewer requests it. The relay is already receiving the track when the first subscriber connects, eliminating the subscription-to-publisher round-trip from the first viewer's join latency.
Consequences¶
- Lower first-viewer latency — data is already flowing at the relay when the first subscriber arrives.
- Publisher pushes proactively — no reactive "subscriber triggers publisher" dependency for live streams.
- Trade-off: relay stores data that may never be consumed if no subscribers arrive; appropriate for live-streaming-like workloads where at least one subscriber is expected.
Seen in¶
- sources/2026-07-31-cloudflare-an-api-for-moq-provision-your-own-isolated-relays — MoQ draft-16
PUBLISHprimitive: "Without PUBLISH, the first subscription must travel through the relay chain to the publisher before the publisher starts sending. With PUBLISH, the relay can already be receiving the track when the first viewer connects."