Skip to main content

fair_drain_priority

Function fair_drain_priority 

Source
fn fair_drain_priority(first: Value, rx: &mut Receiver<Value>) -> Vec<Value>
Expand description

Drain all immediately-available events from rx (including first) and interleave them round-robin by pane (priority_pane_key), instead of forwarding in raw arrival order. Without this, a pane producing output faster than the socket can flush it fills this same lane with its own frames, and a different pane’s keystroke-echo frame — queued in the same FIFO — waits behind the entire backlog. Round-robining bounds that wait to one slot per OTHER distinct pane with events currently queued, regardless of how deep any single pane’s backlog is.

Ordering guarantee: events for the SAME pane are never reordered relative to each other (each pane’s VecDeque is FIFO); only the INTERLEAVING across different panes changes.