Options
All
  • Public
  • Public/Protected
  • All
Menu

Class SessionContext

The default implementation for a session context object.

Hierarchy

  • SessionContext

Implements

Index

Constructors

constructor

  • Construct a new session context.

    Parameters

    Returns SessionContext

Properties

Private _busyDisposable

_busyDisposable: any

Private _changeKernel

_changeKernel: any

Change the kernel.

Private _connectionStatusChanged

_connectionStatusChanged: any

Private _dialog

_dialog: any

Private _disposed

_disposed: any

Private _handleNewSession

_handleNewSession: any

Handle a new session object.

Private _handleSessionError

_handleSessionError: any

Handle an error in session startup.

Private _initPromise

_initPromise: any

Private _initStarted

_initStarted: any

Private _initializing

_initializing: any

Private _iopubMessage

_iopubMessage: any

Private _isDisposed

_isDisposed: any

Private _isReady

_isReady: any

Private _isRestarting

_isRestarting: any

Private _isTerminating

_isTerminating: any

Private _kernelChanged

_kernelChanged: any

Private _kernelPreference

_kernelPreference: any

Private _name

_name: any

Private _onConnectionStatusChanged

_onConnectionStatusChanged: any

Handle a change to the session status.

Private _onIopubMessage

_onIopubMessage: any

Handle an iopub message.

Private _onKernelChanged

_onKernelChanged: any

Handle a change to the kernel.

Private _onPropertyChanged

_onPropertyChanged: any

Handle a change to a session property.

Private _onSessionDisposed

_onSessionDisposed: any

Handle a session termination.

Private _onStatusChanged

_onStatusChanged: any

Handle a change to the session status.

Private _onUnhandledMessage

_onUnhandledMessage: any

Handle an unhandled message.

Private _path

_path: any

Private _pendingKernelName

_pendingKernelName: any

Private _pendingSessionRequest

_pendingSessionRequest: any

Private _prevKernelName

_prevKernelName: any

Private _propertyChanged

_propertyChanged: any

Private _ready

_ready: any

Private _session

_session: any

Private _sessionChanged

_sessionChanged: any

Private _setBusy

_setBusy: any

Private _shutdownSession

_shutdownSession: any

Shut down the current session.

Private _startIfNecessary

_startIfNecessary: any

Start the session if necessary.

returns

Whether to ask the user to pick a kernel.

Private _statusChanged

_statusChanged: any

Private _trans

_trans: any

Private _type

_type: any

Private _unhandledMessage

_unhandledMessage: any

Readonly sessionManager

sessionManager: IManager

The session manager used by the session.

Readonly specsManager

specsManager: IManager

The kernel spec manager

Private translator

translator: any

Accessors

connectionStatusChanged

  • A signal emitted when the kernel status changes, proxied from the kernel.

    Returns ISignal<this, ConnectionStatus>

disposed

  • get disposed(): ISignal<this, void>
  • A signal emitted when the poll is disposed.

    Returns ISignal<this, void>

iopubMessage

  • A signal emitted for iopub kernel messages, proxied from the kernel.

    Returns ISignal<this, IIOPubMessage>

isDisposed

  • get isDisposed(): boolean
  • Test whether the context is disposed.

    Returns boolean

isReady

  • get isReady(): boolean
  • Whether the context is ready.

    Returns boolean

isRestarting

  • get isRestarting(): boolean
  • Whether the context is restarting.

    Returns boolean

isTerminating

  • get isTerminating(): boolean
  • Whether the context is terminating.

    Returns boolean

kernelChanged

  • A signal emitted when the kernel connection changes, proxied from the session connection.

    Returns ISignal<this, IKernelChangedArgs>

kernelDisplayName

  • get kernelDisplayName(): string
  • The display name of the current kernel, or a sensible alternative.

    Notes

    This is a convenience function to have a consistent sensible name for the kernel.

    Returns string

kernelDisplayStatus

  • A sensible status to display

    Notes

    This combines the status and connection status into a single status for the user.

    Returns KernelDisplayStatus

kernelPreference

  • The kernel preference of this client session.

    This is used when selecting a new kernel, and should reflect the sort of kernel the activity prefers.

    Returns IKernelPreference

  • The kernel preference of this client session.

    This is used when selecting a new kernel, and should reflect the sort of kernel the activity prefers.

    Parameters

    Returns any

name

  • get name(): string
  • The session name.

    Notes

    Typically .session.name should be used. This attribute is useful if there is no current session.

    Returns string

path

  • get path(): string
  • The session path.

    Notes

    Typically .session.path should be used. This attribute is useful if there is no current session.

    Returns string

prevKernelName

  • get prevKernelName(): string
  • The name of the previously started kernel.

    Returns string

propertyChanged

  • get propertyChanged(): ISignal<this, "path" | "name" | "type">
  • A signal emitted when a session property changes, proxied from the current session.

    Returns ISignal<this, "path" | "name" | "type">

ready

  • get ready(): Promise<void>
  • A promise that is fulfilled when the context is ready.

    Returns Promise<void>

session

  • The current session connection.

    Returns ISessionConnection | null

sessionChanged

statusChanged

  • get statusChanged(): ISignal<this, Status>
  • A signal emitted when the kernel status changes, proxied from the kernel.

    Returns ISignal<this, Status>

type

  • get type(): string
  • The session type.

    Notes

    Typically .session.type should be used. This attribute is useful if there is no current session.

    Returns string

unhandledMessage

  • get unhandledMessage(): ISignal<this, IMessage>
  • A signal emitted for an unhandled kernel message, proxied from the kernel.

    Returns ISignal<this, IMessage>

Methods

_initialize

  • _initialize(): Promise<boolean>
  • Inner initialize function that doesn't handle promises. This makes it easier to consolidate promise handling logic.

    Returns Promise<boolean>

changeKernel

dispose

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

    Returns void

initialize

  • initialize(): Promise<boolean>
  • Initialize the session context

    Returns Promise<boolean>

    A promise that resolves with whether to ask the user to select a kernel.

    Notes

    If a server session exists on the current path, we will connect to it. If preferences include disabling canStart or shouldStart, no server session will be started. If a kernel id is given, we attempt to start a session with that id. If a default kernel is available, we connect to it. Otherwise we ask the user to select a kernel.

restartKernel

  • restartKernel(): Promise<void>
  • Restart the current Kernel.

    Returns Promise<void>

    A promise that resolves when the kernel is restarted.

shutdown

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

    Returns Promise<void>

    A promise that resolves when the session is shut down.

Generated using TypeDoc