Commit a109347
moq-net: unify info into one demand-driven track request, drop InfoRequest
Per review: collapse the separate InfoRequest/DynamicRequest channel into a
single demand-driven request. info() and subscribe() now coalesce onto one
PendingRequest, so a downstream's parallel TRACK + SUBSCRIBE for a track
triggers exactly one upstream fetch (not two).
Model (broadcast.rs):
- TrackConsumer::info() coalesces onto the same dynamic request as subscribe
(a new info-waiter list on PendingRequest); a single TrackRequest::accept
resolves both the subscribers and the info waiters and caches the Track.
- TrackRequest::subscription() is now Option: None means a pure info() request
with no group demand, so the handler resolves info without subscribing.
- BroadcastDynamic::cached_info() lets a handler skip the upstream TRACK fetch
when the props are already known. Removed InfoRequest, DynamicRequest,
requested_info(), requested(), and the parallel info_requests state.
Relay subscriber (subscriber.rs):
- run_subscribe is demand-gated: it resolves props (cached or one upstream
TRACK fetch) and opens the upstream SUBSCRIBE only when there's group demand,
flighting it alongside the info fetch so a fresh subscribe stays one round
trip. A pure info() request resolves + caches the props and opens no
subscription; if a subscriber coalesces meanwhile, it subscribes then. The
linger lifecycle is factored into serve_lifecycle and reused.
Publisher recv_track is unchanged (still consume_track(name).info().await); it
now drives the unified request.
Tested end-to-end: rs/moq-native broadcast tests cover info() + subscribe over
a real session (cold fetch, then cached reuse), plus the existing timestamp
round-trips. Model unit tests cover warm/cold-coalesced/NotFound/accept-warms.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent d7c1112 commit a109347
2 files changed
Lines changed: 278 additions & 334 deletions
0 commit comments