{ } Raw JSON

bundles / jupyter_client 8.10.0 / jupyter_client / manager / KernelManager / _async_restart_kernel

function

jupyter_client.manager:KernelManager._async_restart_kernel

source: /jupyter_client/manager.py:650

Signature

async def _async_restart_kernel(self, now: bool = False, newports: bool = False, **kw: t.Any) → None

Summary

Restarts a kernel with the arguments that were used to launch it.

Parameters

now : bool, optional

If True, the kernel is forcefully restarted immediately, without having a chance to do any cleanup action. Otherwise the kernel is given 1s to clean up before a forceful restart is issued.

In all cases the kernel is restarted, the only difference is whether it is given a chance to perform a clean shutdown or not.

newports : bool, optional

If the old kernel was launched with random ports, this flag decides whether the same ports and connection file will be used again. If False, the same ports and connection file are used. This is the default. If True, new random port numbers are chosen and a new connection file is written. It is still possible that the newly chosen random port numbers happen to be the same as the old ones.

`**kw` : optional

Any options specified here will overwrite those used to launch the kernel.

Aliases

  • jupyter_client.AsyncKernelManager.restart_kernel