OpenClaw SDK
    Preparing search index...

    Function createGapDetector

    • Create a gap detector.

      Parameters

      Returns GapDetector

      A new GapDetector instance

      import { createGapDetector } from './events/gap.js';

      const gapDetector = createGapDetector({
      expectedSequence: 1,
      onGap: (gapInfo) => {
      console.log(`Gap detected: expected ${gapInfo.expected}, got ${gapInfo.received}`);
      }
      });

      // Process incoming event frames
      gapDetector.processSequence(1); // ok
      gapDetector.processSequence(3); // gap! (missed 2)