intercept method

bool intercept(
  1. Msg msg,
  2. StartupProbeContext ctx
)

Intercepts messages while any probe is active.

Returns true if the runner consumed/buffered the message.

Implementation

bool intercept(Msg msg, StartupProbeContext ctx) {
  final probe = _active;
  if (probe == null) return false;

  if (probe.handleMsg(msg, ctx)) return true;

  if (isCriticalStartupProbeMsg(msg)) {
    _aborted = true;
    probe.abort();
    return false;
  }

  if (probe.gateNonCriticalMessages) {
    _buffered.add(msg);
    return true;
  }

  return false;
}