Datalayer VS Code Extension - v0.0.17
    Preparing search index...

    Simulates a WebSocket connection for a local ZMQ kernel. Routes kernel protocol messages between the webview and the LocalKernelClient. Supports multiple WebSocket connections to the same kernel.

    Index

    Constructors

    • Creates a new LocalKernelProxy instance.

      Parameters

      • _kernelClient: LocalKernelClient

        The local kernel client managing the kernel lifecycle.

      • _webview: WebviewPanel

        The webview panel to send messages to.

      • initialClientId: string

        The initial WebSocket connection ID.

      Returns LocalKernelProxy

      Error if kernel is not started or RawSocket is unavailable.

    Methods

    • Registers an additional WebSocket connection to this kernel.

      Parameters

      • clientId: string

        The WebSocket connection ID to register.

      Returns Record<string, never>

      An empty object for the websocket-open message body.

    • Handles incoming WebSocket messages from the webview. Translates them to kernel protocol operations.

      CRITICAL: Intercepts kernel_info_request and responds immediately with a proper reply. This allows JupyterLab's kernel.ready Promise to resolve correctly.

      Parameters

      • data: unknown

        Raw message data from the webview (string or object).

      Returns void

    • Removes a WebSocket connection from this kernel.

      Parameters

      • clientId: string

        The WebSocket connection ID to remove.

      Returns boolean

      True if there are still active connections, false if this was the last one.