Options
All
  • Public
  • Public/Protected
  • All
Menu

Class SessionManager

An implementation of a session manager.

Hierarchy

  • BaseManager
    • SessionManager

Implements

Index

Constructors

constructor

  • Construct a new session manager.

    Parameters

    • options: IOptions

      The default options for each session.

    Returns SessionManager

Properties

Private Readonly _connectToKernel

_connectToKernel: any

Private _connectionFailure

_connectionFailure: any

Private _isReady

_isReady: any

Private _kernelManager

_kernelManager: any

Private _models

_models: any

Private _onChanged

_onChanged: any

Private _onDisposed

_onDisposed: any

Private _onStarted

_onStarted: any

Handle a session starting.

Private _pollModels

_pollModels: any

Private _ready

_ready: any

Private _runningChanged

_runningChanged: any

Private _sessionConnections

_sessionConnections: any

Readonly serverSettings

serverSettings: ISettings

The server settings for the manager.

Accessors

connectionFailure

  • get connectionFailure(): ISignal<this, Error>
  • A signal emitted when there is a connection failure.

    Returns ISignal<this, Error>

disposed

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

    Returns ISignal<this, void>

isDisposed

  • get isDisposed(): boolean
  • Test whether the delegate has been disposed.

    Returns boolean

isReady

  • get isReady(): boolean
  • Test whether the manager is ready.

    Returns boolean

ready

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

    Returns Promise<void>

runningChanged

  • get runningChanged(): ISignal<this, IModel[]>
  • A signal emitted when the running sessions change.

    Returns ISignal<this, IModel[]>

Methods

connectTo

dispose

  • dispose(): void
  • Dispose of the resources used by the manager.

    Returns void

findById

  • findById(id: string): Promise<IModel | undefined>
  • Find a session by id.

    Parameters

    • id: string

    Returns Promise<IModel | undefined>

findByPath

  • findByPath(path: string): Promise<IModel | undefined>
  • Find a session by path.

    Parameters

    • path: string

    Returns Promise<IModel | undefined>

refreshRunning

  • refreshRunning(): Promise<void>
  • Force a refresh of the running sessions.

    Returns Promise<void>

    A promise that with the list of running sessions.

    Notes

    This is not typically meant to be called by the user, since the manager maintains its own internal state.

Protected requestRunning

  • requestRunning(): Promise<void>
  • Execute a request to the server to poll running kernels and update state.

    Returns Promise<void>

running

  • running(): IIterator<IModel>
  • Create an iterator over the most recent running sessions.

    Returns IIterator<IModel>

    A new iterator over the running sessions.

shutdown

  • shutdown(id: string): Promise<void>
  • Shut down a session by id.

    Parameters

    • id: string

    Returns Promise<void>

shutdownAll

  • shutdownAll(): Promise<void>
  • Shut down all sessions.

    Returns Promise<void>

    A promise that resolves when all of the kernels are shut down.

startNew

  • Start a new session. See also [[startNewSession]].

    Parameters

    • createOptions: ISessionOptions

      Options for creating the session

    • Optional connectOptions: Omit<IOptions, "model" | "connectToKernel" | "serverSettings">

      Options for connecting to the session

    Returns Promise<ISessionConnection>

stopIfNeeded

  • stopIfNeeded(path: string): Promise<void>
  • Find a session associated with a path and stop it if it is the only session using that kernel.

    Parameters

    • path: string

      The path in question.

    Returns Promise<void>

    A promise that resolves when the relevant sessions are stopped.

Generated using TypeDoc