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

    A custom KernelConnection that wraps a local kernel WebSocket. This bypasses the session management and provides a pre-connected kernel.

    Implements

    • IKernelConnection
    Index

    Constructors

    • Parameters

      • options: {
            clientId: string;
            handleComms?: boolean;
            id: string;
            model: IModel;
            name: string;
            serverSettings: ISettings;
            username?: string;
        }

      Returns LocalKernelConnection

    Accessors

    • get anyMessage(): ISignal<this, IAnyMessageArgs>

      Signal emitted for any sent or received message.

      Returns ISignal<this, IAnyMessageArgs>

    • get connectionStatusChanged(): ISignal<this, ConnectionStatus>

      Signal emitted when connection status changes.

      Returns ISignal<this, ConnectionStatus>

    • get iopubMessage(): ISignal<this, IIOPubMessage<IOPubMessageType>>

      Signal emitted for IOPub channel messages.

      Returns ISignal<this, IIOPubMessage<IOPubMessageType>>

    • get pendingInput(): ISignal<this, boolean>

      Signal emitted when pending input state changes.

      Returns ISignal<this, boolean>

    • get spec(): Promise<ISpecModel>

      Get the kernel specification.

      Returns Promise<ISpecModel>

      A promise that resolves to the kernel spec model.

    • get statusChanged(): ISignal<this, Status>

      Signal emitted when kernel status changes.

      Returns ISignal<this, Status>

    • get unhandledMessage(): ISignal<this, IMessage<MessageType>>

      Signal emitted for unhandled kernel messages.

      Returns ISignal<this, IMessage<MessageType>>

    Methods

    • Clone the kernel connection (not supported for local kernels).

      Parameters

      • Optional_options: Partial<Kernel.IKernelConnection.IOptions>

        Optional clone options.

      Returns IKernelConnection

      Always throws as cloning is not implemented.

    • Create a comm (not supported for local kernels).

      Parameters

      • _targetName: string

        The name of the comm target.

      • Optional_commId: string

        Optional comm ID.

      Returns IComm

      Always throws as comm creation is not implemented.

    • Check if a comm with the given ID exists.

      Parameters

      • _commId: string

        The comm ID to check.

      Returns boolean

      Always returns false for local kernels.

    • Interrupt the kernel execution. Sends both an extension message (for local kernels via SIGINT) and an interrupt_request Message to the kernel via the control channel (for remote kernels).

      Returns Promise<void>

      A promise that resolves when the interrupt request is sent.

    • Reconnect to the kernel (no-op for local kernels).

      Returns Promise<void>

      A resolved promise.

    • Register a comm target (no-op for local kernels).

      Parameters

      • _targetName: string

        Identifier for the comm channel to register.

      • _callback: (comm: IComm, msg: ICommOpenMsg) => void | PromiseLike<void>

        Handler invoked when a comm is opened on this target.

      Returns void

    • Register a message hook for IOPub messages (no-op for local kernels).

      Parameters

      • _msgId: string

        The message ID to hook.

      • _hook: (msg: IIOPubMessage) => boolean | PromiseLike<boolean>

        The hook function to register.

      Returns void

    • Remove a comm target (no-op for local kernels).

      Parameters

      • _targetName: string

        Identifier for the comm channel to unregister.

      • _callback: (comm: IComm, msg: ICommOpenMsg) => void | PromiseLike<void>

        Previously registered handler to remove.

      Returns void

    • Remove a message hook (no-op for local kernels).

      Parameters

      • _msgId: string

        The message ID to unhook.

      • _hook: (msg: IIOPubMessage) => boolean | PromiseLike<boolean>

        The hook function to remove.

      Returns void

    • Request comm information (not supported for local kernels).

      Parameters

      • _content: {}

        The comm info request content.

      Returns Promise<ICommInfoReplyMsg>

      Always throws as comm info is not implemented.

    • Request code completion (not supported for local kernels).

      Parameters

      • _content: {}

        The completion request content.

      Returns Promise<ICompleteReplyMsg>

      Always throws as completion is not implemented.

    • Request creation of a subshell (not supported for local kernels).

      Parameters

      • _content: Record<string, unknown>

        The subshell creation request content.

      • Optional_disposeOnDone: boolean

        Whether to dispose after completion.

      Returns IControlFuture<ICreateSubshellRequestMsg, ICreateSubshellReplyMsg>

      Always throws as subshells are not supported.

    • Request debugging information (not supported for local kernels).

      Parameters

      • _content: {}

        The debug request content.

      • Optional_disposeOnDone: boolean

        Whether to dispose after completion.

      Returns IControlFuture<IDebugRequestMsg, IDebugReplyMsg>

      Always throws as debugging is not implemented.

    • Request deletion of a subshell (not supported for local kernels).

      Parameters

      • _content: {}

        The subshell deletion request content.

      • Optional_disposeOnDone: boolean

        Whether to dispose after completion.

      Returns IControlFuture<IDeleteSubshellRequestMsg, IDeleteSubshellReplyMsg>

      Always throws as subshells are not supported.

    • Execute code in the kernel.

      Parameters

      • content: {}

        The code execution request content.

      • OptionaldisposeOnDone: boolean

        Whether to dispose the future after completion.

      • Optionalmetadata: unknown

        Optional metadata to include with the request.

      Returns IShellFuture<IExecuteRequestMsg, IExecuteReplyMsg>

      A shell future that will resolve with the execution reply.

    • Request command history (returns empty history).

      Parameters

      • _content: IHistoryRequestRange | IHistoryRequestSearch | IHistoryRequestTail

        The history request content.

      Returns Promise<IHistoryReplyMsg>

      A promise that resolves with an empty history reply.

    • Request object inspection (not supported for local kernels).

      Parameters

      • _content: {}

        The inspection request content.

      Returns Promise<IInspectReplyMsg>

      Always throws as inspection is not implemented.

    • Check if code is complete (not supported for local kernels).

      Parameters

      • _content: {}

        The is_complete request content.

      Returns Promise<IIsCompleteReplyMsg>

      Always throws as is_complete is not implemented.

    • Request kernel information.

      Returns Promise<IInfoReplyMsg>

      A promise that resolves with the kernel info reply.

    • Request listing of subshells (not supported for local kernels).

      Parameters

      • _content: Record<string, unknown>

        The subshell list request content.

      • Optional_disposeOnDone: boolean

        Whether to dispose after completion.

      Returns IControlFuture<IListSubshellRequestMsg, IListSubshellReplyMsg>

      Always throws as subshells are not supported.

    • Restart the kernel. Sends a message to the extension host to restart the kernel process.

      Returns Promise<void>

      A resolved promise.

    • Send a control message to the kernel.

      Type Parameters

      • T extends ControlMessageType

      Parameters

      • msg: IControlMessage<T>

        The control message to send.

      • Optional_expectReply: boolean

        Whether a reply is expected.

      • Optional_disposeOnDone: boolean

        Whether to dispose after completion.

      Returns IControlFuture<IControlMessage<T>, IControlMessage<ControlMessageType>>

      A control future that will resolve with the reply.

    • Send an input reply to the kernel (not supported for local kernels).

      Parameters

      • _content: ReplyContent<IInputReply>

        The input reply content.

      • _parent_header: unknown

        The parent message header.

      Returns void

      Always throws as input reply is not implemented.

    • Send a shell message to the kernel.

      Type Parameters

      • T extends ShellMessageType

      Parameters

      • msg: IShellMessage<T>

        The shell message to send.

      • Optional_expectReply: boolean

        Whether a reply is expected.

      • Optional_disposeOnDone: boolean

        Whether to dispose after completion.

      Returns IShellFuture<IShellMessage<T>, IShellMessage<ShellMessageType>>

      A shell future that will resolve with the reply.

    • Terminates the kernel and disposes all associated resources.

      Returns Promise<void>

      A resolved promise.