Note
This documentation is for a development version of IPython. There may be significant differences from the latest stable release.
Base class to manage a running kernel
Bases: IPython.kernel.connect.ConnectionFileMixin
Manages a single kernel in a subprocess on this host.
This version starts kernels with Popen.
register a callback to be called when a kernel is restarted
Clean up resources when the kernel is shut down
Create a client configured to connect to our kernel
Wait for kernel shutdown, then kill process if it doesn’t shutdown.
This does not send shutdown requests - use request_shutdown() first.
replace templated args (e.g. {connection_file})
Has a kernel been started that we are managing.
Interrupts the kernel by sending it a signal.
Unlike signal_kernel, this operation is well supported on all platforms.
Is the kernel process still running?
unregister a callback to be called when a kernel is restarted
Send a shutdown request via control channel
On Windows, this just kills kernels instead, because the shutdown messages don’t work.
Restarts a kernel with the arguments that were used to launch it.
If the old kernel was launched with random ports, the same ports will be used for the new kernel. The same connection file is used again.
| Parameters: | now : bool, optional
**kw : optional
|
|---|
Attempts to the stop the kernel process cleanly.
This attempts to shutdown the kernels cleanly by:
| Parameters: | now : bool
restart: bool :
|
|---|
Sends a signal to the kernel.
Note that since only SIGTERM is supported on Windows, this function is only useful on Unix systems.
Starts a kernel on this host in a separate process.
If random ports (port=0) are being used, this method must be called before the channels are created.
| Parameters: | **kw : optional
|
|---|
Start a new kernel, and return its Manager and Client
Context manager to create a kernel in a subprocess.
The kernel is shut down when the context exits.
| Returns: | kernel_client: connected KernelClient instance : |
|---|