edgeport - v1.0.3
    Preparing search index...

    Interface MqttScheduler

    A scheduler for the keep-alive timer, matching the shape of the global timer functions.

    Injected through the internal entry point so a unit test can drive the keep-alive interval with a fake clock and assert a PINGREQ on the wire without waiting real time. Defaults to globalThis.setInterval / clearInterval.

    1.0.0

    interface MqttScheduler {
        clear(handle: unknown): void;
        set(fn: () => void, ms: number): unknown;
    }
    Index
    • Cancels a timer created by set.

      Parameters

      • handle: unknown

      Returns void

    • Schedules fn to run every ms milliseconds; returns a handle for clear.

      Parameters

      • fn: () => void
      • ms: number

      Returns unknown