Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface ISessionContext

A context object to manage a widget's kernel session connection.

Notes

The current session connection is .session, the current session's kernel connection is .session.kernel. For convenience, we proxy several kernel connection and session connection signals up to the session context so that you do not have to manage slots as sessions and kernels change. For example, to act on whatever the current kernel's iopubMessage signal is producing, connect to the session context .iopubMessage signal.

Hierarchy

  • IObservableDisposable
    • ISessionContext

Implemented by

Index

Properties

Readonly connectionStatusChanged

connectionStatusChanged: ISignal<ISessionContext, ConnectionStatus>

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

Readonly disposed

disposed: ISignal<ISessionContext, void>

A signal emitted when the object is disposed.

Readonly hasNoKernel

hasNoKernel: boolean

Whether the kernel is "No Kernel" or not.

Notes

As the displayed name is translated, this can be used directly.

Readonly iopubMessage

iopubMessage: ISignal<ISessionContext, IMessage<MessageType>>

A signal emitted for a kernel messages, proxied from the session connection.

Readonly isDisposed

isDisposed: boolean

Test whether the object has been disposed.

Notes

This property is always safe to access.

Readonly isReady

isReady: boolean

Whether the session context is ready.

Readonly isRestarting

isRestarting: boolean

Whether the session context is restarting.

Readonly isTerminating

isTerminating: boolean

Whether the session context is terminating.

Readonly kernelChanged

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

Readonly kernelDisplayName

kernelDisplayName: string

The sensible display name for the kernel, or translated "No Kernel"

Notes

This is at this level since the underlying kernel connection does not have access to the kernel spec manager.

Readonly kernelDisplayStatus

kernelDisplayStatus: KernelDisplayStatus

A sensible status to display

Notes

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

kernelPreference

kernelPreference: IKernelPreference

The kernel preference for starting new kernels.

Readonly name

name: string

The session name.

Notes

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

Readonly path

path: string

The session path.

Notes

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

Readonly pendingInput

pendingInput: boolean

A flag indicating if session is has pending input, proxied from the session connection.

Readonly prevKernelName

prevKernelName: string

The previous kernel name.

Readonly propertyChanged

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

A signal emitted when a session property changes, proxied from the session connection.

Readonly ready

ready: Promise<void>

A promise that is fulfilled when the session context is ready.

session

The current session connection.

Readonly sessionChanged

sessionChanged: ISignal<ISessionContext, IChangedArgs<ISessionConnection, ISessionConnection, "session">>

A signal emitted when the session connection changes.

Readonly sessionManager

sessionManager: IManager

The session manager used by the session.

Readonly specsManager

specsManager: IManager

The kernel spec manager

Readonly statusChanged

statusChanged: ISignal<ISessionContext, Status>

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

Readonly type

type: string

The session type.

Notes

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

Readonly unhandledMessage

unhandledMessage: ISignal<ISessionContext, IMessage<MessageType>>

A signal emitted for an unhandled kernel message, proxied from the session connection.

Methods

changeKernel

  • Change the kernel associated with the session.

    Parameters

    • Optional options: Partial<IModel>

      The optional kernel model parameters to use for the new kernel.

    Returns Promise<IKernelConnection>

    A promise that resolves with the new kernel connection.

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

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

    This includes starting up an initial kernel if needed.

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