Skip to main content

select_reach

Function select_reach 

Source
pub fn select_reach(
    advertised: &[Destination],
    qos: &StreamOpt,
) -> Vec<Destination>
Expand description

Reorder the service-advertised reach list by the QoS-preferred topology (#358), returning a new list the caller hands to connect_moq_reach.

  • Retention::Live (Pipe / live console, lowest-latency) → direct-first: a live pipe wants the shortest path; the relay is the fallback only if the producer is not directly reachable.
  • retained / resumable / fan-out (Job / Log, Retention::{Blocks,Seconds}) → relay-first: the relay is the natural late-join / retained / fan-out surface, and lets a subscriber rendezvous without dialing the producer.

The reorder is stable (it preserves the service’s relative ordering within each role), so direct reaches keep their advertised priority (e.g. iroh before Quic) and the only change is whether the relay group floats to the front.