Skip to main content

frontier_within_lag

Function frontier_within_lag 

Source
pub fn frontier_within_lag(
    frontier: &Antichain<Timestamp>,
    reference: &Antichain<Timestamp>,
    allowed_lag: Timestamp,
) -> bool
Expand description

Returns whether frontier is at most allowed_lag behind reference.

The predicate is reference <= frontier + allowed_lag, evaluated on antichains. Timestamps that would overflow when advanced by allowed_lag saturate at Timestamp::MAX rather than panicking, so a frontier close to the end of the timestamp domain reads as far ahead rather than aborting the caller.

Note the two degenerate cases, which callers usually want to handle themselves rather than inherit:

  • An empty reference is the maximum antichain, so the result is true only when frontier is empty too. It denotes completion, which a finite frontier cannot satisfy, regardless of the allowance.
  • An empty frontier is likewise the maximum, so the result is true for every reference.