Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface ISession

Interface of a session object.

Hierarchy

  • IDisposable
    • ISession

Implemented by

Index

Properties

anyMessage

anyMessage: ISignal<this, IAnyMessageArgs>

A signal emitted for any kernel message.

Note: The behavior is undefined if the message is modified during message handling. As such, it should be treated as read-only.

id

id: string

Unique id of the session.

iopubMessage

iopubMessage: ISignal<this, IIOPubMessage>

A signal emitted for iopub kernel messages.

isDisposed

isDisposed: boolean

Test whether the object has been disposed.

Notes

This property is always safe to access.

kernel

The kernel.

Notes

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

kernelChanged

kernelChanged: ISignal<this, IKernelChangedArgs>

A signal emitted when the kernel changes.

model

model: IModel

The model associated with the session.

name

name: string

The current name associated with the session.

path

path: string

The current path associated with the session.

propertyChanged

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

A signal emitted when a session property changes.

serverSettings

serverSettings: ISettings

The server settings of the session.

status

status: Status

The current status of the session.

Notes

This is a delegate to the kernel status.

statusChanged

statusChanged: ISignal<this, Status>

A signal emitted when the session status changes.

terminated

terminated: ISignal<this, void>

A signal emitted when the session is shut down.

type

type: string

The type of the session.

unhandledMessage

unhandledMessage: ISignal<this, IMessage>

A signal emitted for unhandled kernel message.

Methods

changeKernel

  • Change the kernel.

    Parameters

    • options: Partial<IModel>

      The name or id of the new kernel.

    Returns Promise<IKernelConnection>

    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.

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>

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>

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