Skip to main content

race

Function race 

Source
pub fn race(
    core: &Core,
    binding: &Arc<dyn ProducerBinding>,
    sources: Vec<NodeId>,
) -> NodeId
Expand description

race(s1, s2, ..., sN) — subscribes to all sources; the first to emit DATA wins. Subsequent traffic from the winner is forwarded; losers’ messages are no-ops (per Q4=(b) — losers stay subscribed but their sink callbacks short-circuit). Saves the dynamic rewiring cost of explicitly unsubscribing losers.

Empty source list completes immediately. Single source is identity-passthrough.