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

    Properties

    _anyMessage: Signal<LocalKernelConnection, IAnyMessageArgs> = ...

    Signal emitted for any message (sent or received).

    _clientId: string

    The client session ID.

    _connectionStatus: ConnectionStatus = "connected"

    The current connection status of the kernel.

    _connectionStatusChanged: Signal<LocalKernelConnection, ConnectionStatus> = ...

    Signal emitted when connection status changes.

    _disposed: Signal<LocalKernelConnection, void> = ...

    Signal emitted when the kernel is disposed.

    _handleComms: boolean = true

    Whether this connection should handle comm (widget) messages.

    _id: string

    The unique identifier of the kernel.

    _infoPromise: Promise<IInfoReply>

    Promise that resolves when kernel info is received.

    _infoReply: IInfoReply = null

    The cached kernel info reply.

    _iopubMessage: Signal<LocalKernelConnection, IIOPubMessage<IOPubMessageType>> = ...

    Signal emitted when an iopub message is received.

    _isDisposed: boolean = false

    Whether the kernel connection has been disposed.

    _model: IModel

    The kernel model containing kernel specifications.

    _name: string

    The name of the kernel.

    _pendingMessages: Signal<LocalKernelConnection, boolean> = ...

    Signal emitted when pending input state changes.

    _propertyChanged: Signal<LocalKernelConnection, "name" | "type" | "path"> = ...

    Signal emitted when kernel properties change.

    _resolveInfo: (value: IInfoReply) => void

    Function to resolve the kernel info promise.

    _serverSettings: ISettings

    Server settings for the kernel connection.

    _status: Status = "unknown"

    The current execution status of the kernel.

    _statusChanged: Signal<LocalKernelConnection, Status> = ...

    Signal emitted when kernel status changes.

    _unhandledMessage: Signal<LocalKernelConnection, IMessage<MessageType>> = ...

    Signal emitted when an unhandled message is received.

    _username: string = ""

    The username associated with the kernel.

    The WebSocket connection to the local kernel.

    Accessors

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

      A signal emitted when any kernel message is sent or received.

      This signal is emitted before any message handling has happened. The message should be treated as read-only.

      Returns ISignal<this, IAnyMessageArgs>

    • get clientId(): string

      The client unique id.

      This should be unique for a particular kernel connection object.

      Returns string

    • set clientId(value: string): void

      The client unique id.

      This should be unique for a particular kernel connection object.

      Parameters

      • value: string

      Returns void

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

      A signal emitted when the kernel connection status changes.

      Returns ISignal<this, ConnectionStatus>

    • get hasPendingInput(): boolean

      Whether the kernel connection has pending input.

      This is a guard to avoid deadlock is the user asks input as second time before submitting his first input

      Returns boolean

    • get info(): Promise<IInfoReply>

      The kernel info

      This promise only resolves at startup, and is not refreshed on every restart.

      Returns Promise<IInfoReply>

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

      A signal emitted after an iopub kernel message is handled.

      Returns ISignal<this, IIOPubMessage<IOPubMessageType>>

    • get isDisposed(): boolean

      Test whether the object has been disposed.

      This property is always safe to access.

      Returns boolean

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

      A signal emitted when a kernel has pending inputs from the user.

      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>

      A signal emitted when the kernel status changes.

      Returns ISignal<this, Status>

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

      A signal emitted for unhandled non-iopub kernel messages that claimed to be responses for messages we sent using this kernel object.

      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.

    • 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

        The name of the comm target.

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

        The callback to invoke when a comm is opened.

      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

        The name of the comm target.

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

        The callback 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.

    • 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.