Options
All
  • Public
  • Public/Protected
  • All
Menu

Module Session

A namespace for session interfaces and factory functions.

Index

Functions

connectTo

  • Connect to a running session.

    Parameters

    • model: IModel

      The model of the target session.

    • Optional settings: ISettings

    Returns ISession

    The session instance.

    Notes

    If the session was already started via startNew, the existing Session object is used as the fulfillment value.

    Otherwise, we attempt to connect to the existing session.

findById

  • Find a session by id.

    Parameters

    • id: string

      The id of the target session.

    • Optional settings: ISettings

      The server settings.

    Returns Promise<IModel>

    A promise that resolves with the session model.

    Notes

    If the session was already started via startNew, the existing Session object's information is used in the fulfillment value.

    Otherwise, we attempt to find to the existing session. The promise is fulfilled when the session is found, otherwise the promise is rejected.

findByPath

  • Find a session by path.

    Parameters

    • path: string

      The path of the target session.

    • Optional settings: ISettings

    Returns Promise<IModel>

    A promise that resolves with the session model.

    Notes

    If the session was already started via startNewSession, the existing Session object's info is used in the fulfillment value.

    Otherwise, we attempt to find to the existing session using [listRunningSessions]. The promise is fulfilled when the session is found, otherwise the promise is rejected.

    If the session was not already started and no options are given, the promise is rejected.

listRunning

  • List the running sessions.

    Parameters

    • Optional settings: ISettings

      The server settings to use for the request.

    Returns Promise<IModel[]>

    A promise that resolves with the list of session models.

    Notes

    Uses the Jupyter Notebook API, and validates the response.

    All client-side sessions are updated with current information.

    The promise is fulfilled on a valid response and rejected otherwise.

shutdown

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

    Parameters

    • id: string

      The id of the target session.

    • Optional settings: ISettings

      The server settings.

    Returns Promise<void>

    A promise that resolves when the session is shut down.

shutdownAll

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

    Parameters

    Returns Promise<void>

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

startNew

  • Start a new session.

    Parameters

    • options: IOptions

      The options used to start the session.

    Returns Promise<ISession>

    A promise that resolves with the session instance.

    Notes

    Uses the Jupyter Notebook API, and validates the response.

    A path must be provided. If a kernel id is given, it will connect to an existing kernel. If no kernel id or name is given, the server will start the default kernel type.

    The promise is fulfilled on a valid response and rejected otherwise.

    Wrap the result in an Session object. The promise is fulfilled when the session is created on the server, otherwise the promise is rejected.

Generated using TypeDoc