Commit f37b862
moq-net: resolve track info via model TrackConsumer::info(), not subscribe
Addresses PR review: the publisher must not open a subscription just to learn
a track's immutable properties. Add a first-class info path to the model and
route every property lookup (publisher TRACK reply, subscriber SUBSCRIBE) and
the cache through it.
Model (broadcast.rs):
- TrackConsumer::info() -> InfoPending: resolves a track's immutable Track
(timescale/compression/cache) without subscribing. Warm (a live producer
exists, or the value is cached) it resolves with no round trip; cold it
queues a dynamic info request.
- New dynamic info-request channel mirroring requested_track/TrackRequest:
BroadcastDynamic::requested_info() -> InfoRequest::resolve(Track)/deny, plus
a combined requested() -> DynamicRequest{Track,Info} so one loop serves both.
- track_info cache keyed by name (a re-announce replaces the broadcast and
State, invalidating it). TrackRequest::accept warms it, so a subscribe and a
concurrent TRACK coalesce. Group-by-group fetches (which keep no track-level
producer) reuse the one cached lookup.
Publisher: recv_track now calls consume_track(name).info().await instead of
subscribing-and-dropping. The spawn stays (a cold relay lookup is an upstream
round trip; the accept loop must not block on it).
Subscriber: the relay serves downstream info requests (run_info) by fetching
TRACK_INFO upstream and caching it; its own lite-05 SUBSCRIBE path now resolves
props through info() too, so a downstream's parallel TRACK + SUBSCRIBE collapse
to a single upstream TRACK fetch.
Tests cover warm/cold/coalesced/NotFound info() and accept-warms-cache.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 0ba9972 commit f37b862
3 files changed
Lines changed: 437 additions & 25 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
564 | 564 | | |
565 | 565 | | |
566 | 566 | | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
567 | 570 | | |
568 | 571 | | |
569 | 572 | | |
| |||
587 | 590 | | |
588 | 591 | | |
589 | 592 | | |
590 | | - | |
591 | | - | |
592 | | - | |
593 | | - | |
594 | | - | |
595 | | - | |
596 | | - | |
597 | | - | |
598 | | - | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
599 | 598 | | |
600 | 599 | | |
601 | 600 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
463 | 463 | | |
464 | 464 | | |
465 | 465 | | |
466 | | - | |
| 466 | + | |
467 | 467 | | |
468 | 468 | | |
469 | 469 | | |
470 | 470 | | |
471 | | - | |
| 471 | + | |
472 | 472 | | |
473 | 473 | | |
474 | 474 | | |
| |||
478 | 478 | | |
479 | 479 | | |
480 | 480 | | |
481 | | - | |
482 | 481 | | |
483 | | - | |
484 | | - | |
485 | | - | |
486 | | - | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
487 | 520 | | |
488 | 521 | | |
489 | 522 | | |
| |||
570 | 603 | | |
571 | 604 | | |
572 | 605 | | |
573 | | - | |
574 | 606 | | |
575 | 607 | | |
576 | 608 | | |
| |||
609 | 641 | | |
610 | 642 | | |
611 | 643 | | |
612 | | - | |
613 | | - | |
614 | | - | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
615 | 651 | | |
616 | | - | |
| 652 | + | |
617 | 653 | | |
618 | 654 | | |
619 | 655 | | |
620 | 656 | | |
621 | | - | |
622 | | - | |
| 657 | + | |
| 658 | + | |
623 | 659 | | |
624 | 660 | | |
625 | 661 | | |
626 | 662 | | |
627 | 663 | | |
628 | 664 | | |
629 | | - | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
630 | 673 | | |
631 | 674 | | |
632 | 675 | | |
| |||
0 commit comments