A Jupyter server session.

Hierarchy

Implements

Constructors

Properties

_kernelStatus: KernelStatus = KernelStatus.disconnected
_kernelStatusChanged: Signal<ISession, KernelStatus> = ...
_language: KernelLanguage = KernelLanguage.r
_serverStatus: ServerStatus = ServerStatus.disconnected
_serverStatusChanged: Signal<ISession, ServerStatus> = ...
activeRequest?: SessionRequest

The request that is currently active in the queue.

activeRequester?: IRequester

The object whose request is currently being processed.

changingLanguage: boolean = false

Whether the session is currently changing language.

context: SessionContext

The current session context.

isReady: boolean = false
kernelManager: KernelManager = null
log: ILogger
queue: QueuedRequest[] = []
readyDelegate?: PromiseDelegate<void>
serverSettings?: ISettings

The settings for the server connection.

serviceManager: ServiceManager = null
sessionManager: SessionManager = null
specsManager: KernelSpecManager = null
startupScript?: {
    python: string;
    r: string;
}

Code to run every time a kernel is (re)started.

Type declaration

  • python: string
  • r: string
_instance: JupyterSession

Accessors

Methods

  • Execute a request on a kernel and return an IOutputAdapterFuture.

    Parameters

    • request: {
          request: {
              allow_stdin?: boolean;
              code: string;
              silent?: boolean;
              stop_on_error?: boolean;
              store_history?: boolean;
              user_expressions?: JSONObject;
          };
          requester?: IRequester;
          type?: execute;
      }

      the request to execute

      • request: {
            allow_stdin?: boolean;
            code: string;
            silent?: boolean;
            stop_on_error?: boolean;
            store_history?: boolean;
            user_expressions?: JSONObject;
        }
        • Optional allow_stdin?: boolean

          Whether to allow stdin requests. The default is true.

        • code: string

          The code to execute.

        • Optional silent?: boolean

          Whether to execute the code as quietly as possible. The default is false.

        • Optional stop_on_error?: boolean

          Whether to the abort execution queue on an error. The default is false.

        • Optional store_history?: boolean

          Whether to store history of the execution. The default true if silent is False. It is forced to false if silent is true.

        • Optional user_expressions?: JSONObject

          A mapping of names to expressions to be evaluated in the kernel's interactive namespace.

      • Optional requester?: IRequester
      • Optional type?: execute
    • delegate: PromiseDelegate<void>

      a delegate to resolve the promise made to the requester

    Returns IOutputAdapterFuture

    an IOutputAdapterFuture that can be used to react to output messages

  • Join the queue to execute a request.

    The queue is a list of execution requests as well as kernel language changes. The queue will accept requests from up to two cells at a time: the current cell and the next cell. If a third cell joins the queue, any requests from the second cell will be dropped. The queue will otherwise execute requests in order.

    Type Parameters

    Parameters

    • request: T

      the request to execute

    Returns Promise<QueuedReturn<T>>

    a promise that resolves when the request is complete, or rejects if the kernel dies, the connection is lost, or the request is dropped from the queue.

Generated using TypeDoc