route_until_reporting

Function route_until_reporting 

Source
pub fn route_until_reporting<const N: usize, W: WaitStrategy>(
    router: &FanoutRouter<N>,
    cfg: RouterLoopConfig,
    wait: &mut W,
    should_stop: impl FnMut() -> bool,
    report_period: Duration,
    report: impl FnMut(RouterCounters),
) -> RouterCounters
Expand description

Run a fanout router until should_stop() returns true, periodically reporting counters.

Notes:

  • Reporting is best-effort and uses std::time::Instant, so this is std-only.
  • report is invoked at most once per report_period, and once at the end.