Datalayer VS Code Extension - v0.0.6
    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

    Properties

    _clientIds: Set<string> = ...
    _kernel: IKernelConnection
    _kernelClient: LocalKernelClient
    _kernelSessionId: string = null
    _messageHandlers: Map<string, (msg: IMessage) => void> = ...
    _rawSocket: unknown
    _sessionIdMap: Map<string, string> = ...
    _webview: WebviewPanel

    Methods

    • Forwards a kernel message to the webview as a WebSocket message. Sanitizes Buffer objects in the idents field to proper format for postMessage. Also translates the kernel's session ID to JupyterLab's expected session ID.

      Parameters

      • msg: IMessage

      Returns void

    • Sends a message to the webview. Broadcasts to all registered client connections, or to a specific client if specified.

      Parameters

      • type: string
      • body: unknown
      • OptionalspecificClientId: string

      Returns void

    • Registers an additional WebSocket connection to this kernel. Returns an empty object for the websocket-open message body.

      Parameters

      • clientId: string

      Returns Record<string, never>

    • 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

      Returns void

    • Removes a WebSocket connection from this kernel. Returns true if there are still active connections, false if this was the last one.

      Parameters

      • clientId: string

      Returns boolean