Options
All
  • Public
  • Public/Protected
  • All
Menu

Module Kernel

A namespace for kernel types, interfaces, and type checker functions.

Index

Type aliases

Status

Status: "unknown" | "starting" | "reconnecting" | "idle" | "busy" | "restarting" | "autorestarting" | "dead" | "connected"

The valid Kernel status states.

Functions

connectTo

  • Connect to a running kernel.

    Parameters

    • model: IModel

      The model of the running kernel.

    • Optional settings: ISettings

      The server settings for the request.

    Returns IKernel

    The kernel object.

    Notes

    If the kernel was already started via startNewKernel, the existing Kernel object info is used to create another instance.

findById

  • Find a kernel by id.

    Parameters

    • id: string

      The id of the kernel of interest.

    • Optional settings: ISettings

      The optional server settings.

    Returns Promise<IModel>

    A promise that resolves with the model for the kernel.

    Notes

    If the kernel was already started via startNewKernel, we return its Kernel.IModel. Otherwise, we attempt to find the existing kernel. The promise is fulfilled when the kernel is found, otherwise the promise is rejected.

getSpecs

listRunning

  • Fetch the running kernels.

    Parameters

    • Optional settings: ISettings

      The optional server settings.

    Returns Promise<IModel[]>

    A promise that resolves with the list of running kernels.

    Notes

    Uses the Jupyter Notebook API and validates the response model.

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

shutdown

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

    Parameters

    • id: string

      The id of the running kernel.

    • Optional settings: ISettings

      The server settings for the request.

    Returns Promise<void>

    A promise that resolves when the kernel is shut down.

shutdownAll

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

    Parameters

    Returns Promise<void>

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

startNew

  • Start a new kernel.

    Parameters

    • Default value options: IOptions = {}

      The options used to create the kernel.

    Returns Promise<IKernel>

    A promise that resolves with a kernel object.

    Notes

    Uses the Jupyter Notebook API and validates the response model.

    If no options are given or the kernel name is not given, the default kernel will by started by the server.

    Wraps the result in a Kernel object. The promise is fulfilled when the kernel is started by the server, otherwise the promise is rejected.

Generated using TypeDoc