OpenClaw SDK
    Preparing search index...

    Class TimeoutManager

    Centralized timeout management utility.

    Provides:

    • Automatic cleanup on manager destruction
    • Promise-based delays
    • Named timeouts for debugging
    • Batch timeout management
    Index

    Constructors

    Accessors

    Methods

    • Set a named timeout.

      Parameters

      • callback: () => void

        Function to execute on timeout

      • ms: number

        Timeout in milliseconds

      • Optionalname: string

        Optional name for debugging

      Returns TimeoutHandle

      TimeoutHandle for clearing the timeout

    • Set a timeout with a Promise-based API.

      Parameters

      • ms: number

        Delay in milliseconds

      Returns Promise<void>

      Promise that resolves after the delay

    • Set a timeout that can be awaited.

      Parameters

      • ms: number

        Delay in milliseconds

      Returns { promise: Promise<void>; cancel: () => void }

      Object with promise and cancel function

    • Clear a specific timeout by ID.

      Parameters

      • id: string

        The timeout ID to clear

      Returns boolean

      true if timeout was found and cleared

    • Check if a specific timeout is active.

      Parameters

      • id: string

        The timeout ID to check

      Returns boolean

      true if the timeout is active

    • Destroy the manager and clear all timeouts. Should be called when the manager is no longer needed.

      Returns void