Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface ISessionConnection

Interface of a session object.

A session object represents a live connection to a session kernel.

This represents a persistent kernel connection with a particular key, that persists across changing kernels and kernels getting terminated. As such, a number of signals are proxied from the current kernel for convenience.

The kernel is owned by the session, in that the session creates the kernel and manages its lifecycle.

Hierarchy

  • IObservableDisposable
    • ISessionConnection

Index

Properties

anyMessage

anyMessage: ISignal<this, IAnyMessageArgs>

The kernel anyMessage signal, proxied from the current kernel.

connectionStatusChanged

connectionStatusChanged: ISignal<this, ConnectionStatus>

The kernel connectionStatusChanged signal, proxied from the current kernel.

Readonly disposed

disposed: ISignal<this, void>

A signal emitted when the object is disposed.

Readonly id

id: string

Unique id of the session.

iopubMessage

iopubMessage: ISignal<this, IIOPubMessage>

The kernel iopubMessage signal, proxied from the current kernel.

Readonly isDisposed

isDisposed: boolean

Test whether the object has been disposed.

Notes

This property is always safe to access.

Readonly kernel

kernel: IKernelConnection | null

The kernel.

Notes

This is a read-only property, and can be altered by [changeKernel].

A number of kernel signals are proxied through the session from whatever the current kernel is for convenience.

kernelChanged

kernelChanged: ISignal<this, IChangedArgs<IKernelConnection | null, IKernelConnection | null, "kernel">>

A signal emitted when the kernel changes.

Readonly model

model: IModel

The model associated with the session.

Readonly name

name: string

The current name associated with the session.

Readonly path

path: string

The current path associated with the session.

Readonly propertyChanged

propertyChanged: ISignal<this, "path" | "name" | "type">

A signal emitted when a session property changes.

Readonly serverSettings

serverSettings: ISettings

The server settings of the session.

statusChanged

statusChanged: ISignal<this, Status>

The kernel statusChanged signal, proxied from the current kernel.

Readonly type

type: string

The type of the session.

unhandledMessage

unhandledMessage: ISignal<this, IMessage>

The kernel unhandledMessage signal, proxied from the current kernel.

Methods

changeKernel

  • Change the kernel.

    Parameters

    • options: Partial<IModel>

      The name or id of the new kernel.

    Returns Promise<IKernelConnection | null>

    A promise that resolves with the new kernel model.

    Notes

    This shuts down the existing kernel and creates a new kernel, keeping the existing session ID and path. The session assumes it owns the kernel.

    To start now kernel, pass an empty dictionary.

dispose

  • dispose(): void
  • Dispose of the resources held by the object.

    Notes

    If the object's dispose method is called more than once, all calls made after the first will be a no-op.

    Undefined Behavior

    It is undefined behavior to use any functionality of the object after it has been disposed unless otherwise explicitly noted.

    Returns void

setName

  • setName(name: string): Promise<void>
  • Change the session name.

    Parameters

    • name: string

    Returns Promise<void>

    A promise that resolves when the session has renamed.

    Notes

    This uses the Jupyter REST API, and the response is validated. The promise is fulfilled on a valid response and rejected otherwise.

setPath

  • setPath(path: string): Promise<void>
  • Change the session path.

    Parameters

    • path: string

      The new session path.

    Returns Promise<void>

    A promise that resolves when the session has renamed.

    Notes

    This uses the Jupyter REST API, and the response is validated. The promise is fulfilled on a valid response and rejected otherwise.

setType

  • setType(type: string): Promise<void>
  • Change the session type.

    Parameters

    • type: string

    Returns Promise<void>

    A promise that resolves when the session has renamed.

    Notes

    This uses the Jupyter REST API, and the response is validated. The promise is fulfilled on a valid response and rejected otherwise.

shutdown

  • shutdown(): Promise<void>
  • Kill the kernel and shutdown the session.

    Returns Promise<void>

    A promise that resolves when the session is shut down.

    Notes

    This uses the Jupyter REST API, and the response is validated. The promise is fulfilled on a valid response and rejected otherwise.

Generated using TypeDoc