Skip to main content

within_windows

Function within_windows 

Source
pub fn within_windows(lines: &[Line]) -> HashSet<&str>
Expand description

The ids of the tells and asks of lines within what every window admits (window_for): each one that a recipient acknowledged, and each that, with the sender’s later messages to the same recipient stamped within V1_RATE_MS of it, makes at most WINDOW_CAP unacknowledged ones.

No window lets more through: of the messages a sender wrote within one V1_RATE_MS, the last unread one went with fewer than WINDOW_CAP unread before it (its window held them all, outstanding), or by the rate alone, V1_RATE_MS after the sender’s previous message. So it never refuses what send wrote, and a writer that ignores its window gets at most this through. It reads only a message, its pair’s later ones and their acknowledgements, never an earlier line, so the TTL and the bound, which cut the oldest first, never take a line out of it while the line is held (an acknowledgement cut by its node’s share before the message it lists aside), and it is a function of the lines alone: every node holding the same lines decides the same, whatever order they arrived in (borg-mesh sync.rs window, on offer and on receipt).