MLightCAD
    Preparing search index...

    A utility class that waits until a specified condition is met or a timeout occurs, and then executes a single action.

    const waiter = new AcEdConditionWaiter(
    () => isDataReady(), // condition
    () => log.info('Ready or timed out'), // action
    1000, // check every 1s
    10000 // timeout after 10s
    );

    waiter.start();
    Index

    Constructors

    Methods

    Constructors

    • Creates a new AcEdConditionWaiter.

      Parameters

      • condition: () => boolean

        The condition function to check periodically.

      • action: () => void

        The action to execute once when the condition is met or timeout occurs.

      • checkInterval: number = 1000

        How often (ms) to check the condition. Default: 1000 ms.

      • timeout: number = 0

        Maximum time (ms) to wait before executing the action. Default: 0 (no timeout).

      Returns AcEdConditionWaiter

    Methods