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

    Raw ZMQ socket that wraps kernel channels in WebSocket-like interface. Used by @jupyterlab/services for kernel communication.

    Index

    Constructors

    • Creates a new RawSocket instance that wraps ZMQ channels in a WebSocket-like interface. Initializes kernel communication channels (shell, control, stdin, iopub).

      Parameters

      • connection: IKernelConnection

        Kernel connection configuration from the connection file

      • serialize: (msg: IMessage) => string | ArrayBuffer

        Function to serialize kernel messages to string or ArrayBuffer format

      Returns RawSocket

    Properties

    channels: IChannels

    ZMQ channels for kernel communication. Contains shell, control, stdin (DEALER) and iopub (SUBSCRIBER) channels.

    closed: boolean = false

    Flag indicating whether the socket has been closed. Prevents message processing after closure.

    connection: IKernelConnection

    Kernel connection configuration from the connection file

    msgChain: Promise<unknown> = ...

    Promise chain for sequencing message receive operations. Ensures messages are processed in order by chaining async operations.

    onclose: (
        event: {
            code: number;
            reason: string;
            target: unknown;
            wasClean: boolean;
        },
    ) => void = noop

    Callback invoked when the socket connection closes. Signature: (event: { wasClean: boolean; code: number; reason: string; target: unknown }) => void

    onerror: (
        event: {
            error: unknown;
            message: string;
            target: unknown;
            type: string;
        },
    ) => void = noop

    Callback invoked when a socket error occurs. Signature: (event: { error: unknown; message: string; type: string; target: unknown }) => void

    onmessage: (event: { data: Data; target: unknown; type: string }) => void = noop

    Callback invoked when a message is received from the kernel. Signature: (event: { data: WebSocketWS.Data; type: string; target: unknown }) => void

    onopen: (event: { target: unknown }) => void = noop

    Callback invoked when the socket connection opens. Signature: (event: { target: unknown }) => void

    protocol: ""

    WebSocket protocol version string. Empty for raw ZMQ sockets, matches WebSocket interface.

    receiveHooks: ((data: Data) => Promise<void>)[] = []

    Array of hooks to be called when receiving messages from the kernel. Each hook receives serialized message data and must complete before the message is processed. Used for intercepting and transforming incoming messages.

    sendChain: Promise<unknown> = ...

    Promise chain for sequencing message send operations. Ensures messages are sent in order by chaining async operations.

    sendHooks: ((data: unknown, cb?: (err?: Error) => void) => Promise<void>)[] = []

    Array of hooks to be called when sending messages to the kernel. Each hook receives the message data and an optional callback for error reporting. Used for intercepting and transforming outgoing messages.

    serialize: (msg: IMessage) => string | ArrayBuffer

    Function to serialize kernel messages to string or ArrayBuffer format

    Methods

    • Parameters

      • hook: (data: unknown, cb?: (err?: Error) => void) => Promise<void>

      Returns void

    • Parameters

      • channel: Channel
      • readable: Subscriber | Dealer

      Returns Promise<void>

    • Parameters

      • hook: (data: unknown, cb?: (err?: Error) => void) => Promise<void>

      Returns void