Skip to main content

plan_upstream

Function plan_upstream 

Source
pub fn plan_upstream(
    self_node_id: &str,
    class: ReplicaClass,
    requested: Option<&CascadeUpstream>,
) -> (UpstreamChoice, Option<CascadeRefusal>)
Expand description

Decide where a node streams from, given its streaming class and an optionally-requested intermediate source.

The decision is total and side-effect-free:

Returning the refusal alongside the (safe) fallback choice lets the caller honour the connection immediately while still logging why a configured cascade did not take effect.