AbstractCreates a new kernel manager instance.
Jupyter server connection settings
Protected_Currently active kernel connection. Most custom managers (mock, Pyodide, local) support only one kernel at a time.
Protected_Signal emitted when connection to kernel fails. Used for error propagation to UI components.
Protected_Signal emitted when manager is disposed. Used for cleanup and resource management.
Protected_Disposal state flag.
Protected_Ready state flag. True for synchronous managers (mock, Pyodide, local).
Protected_Ready promise that resolves immediately. All custom managers are ready synchronously.
Protected_Signal emitted when running kernels change. Emitted after kernel startup, shutdown, or disposal.
Abstract ReadonlymanagerType identifier for this kernel manager. Must be implemented by subclasses.
Jupyter server connection settings
Signal emitted when manager is disposed. Used for cleanup in consuming components.
Whether the manager is active and functional. Returns false after disposal.
Whether the manager has been disposed.
Whether the manager is ready to create kernels. Always true for custom managers (mock, Pyodide, local).
Promise that resolves when manager is ready. Resolves immediately for custom managers.
Number of currently running kernels. For single-kernel managers (mock, Pyodide, local), returns 0 or 1.
Connect to an existing kernel.
For single-kernel managers, typically returns the active kernel or throws an error. Override for custom behavior.
Connection options (unused in base implementation)
Kernel connection
Dispose of the kernel manager and all resources.
Shuts down active kernels, disconnects signals, marks as disposed. Subclasses should call super.dispose() after their cleanup.
Find a kernel by ID.
Standard implementation checks if the active kernel matches.
Kernel identifier
Kernel model if found, undefined otherwise
ProtectedlogRefresh the list of running kernels.
No-op for custom managers that don't poll a server. Override in remote managers that need to sync with server state.
Request the list of running kernels from the server.
For custom managers (mock, local, Pyodide), returns the current active kernel. Remote managers should override this to query the actual Jupyter server.
Promise resolving to array of running kernel models
AbstractstartStart a new kernel.
Must be implemented by subclasses to provide manager-specific kernel creation logic.
Optionaloptions: Partial<Pick<Kernel.IModel, "name">>Kernel creation options (name, etc.)
OptionalconnectOptions: Omit<Kernel.IKernelConnection.IOptions, "model" | "serverSettings">Connection options (clientId, username, etc.)
Promise resolving to the new kernel connection
Protectedvalidate
Abstract base class for kernel manager implementations.
Implements common Kernel.IManager interface methods that are identical across all manager types, reducing code duplication and ensuring consistency.
This class implements both the standard JupyterLab Kernel.IManager interface and the custom ITypedKernelManager interface for type discrimination.
Example