##// END OF EJS Templates
enable graceful restart of kernels in notebook
MinRK -
Show More
@@ -43,7 +43,7 b' class MultiKernelManager(LoggingConfigurable):'
43 """A class for managing multiple kernels."""
43 """A class for managing multiple kernels."""
44
44
45 kernel_manager_class = DottedObjectName(
45 kernel_manager_class = DottedObjectName(
46 "IPython.zmq.kernelmanager.KernelManager", config=True,
46 "IPython.zmq.blockingkernelmanager.BlockingKernelManager", config=True,
47 help="""The kernel manager class. This is configurable to allow
47 help="""The kernel manager class. This is configurable to allow
48 subclassing of the KernelManager for customized behavior.
48 subclassing of the KernelManager for customized behavior.
49 """
49 """
@@ -87,6 +87,8 b' class MultiKernelManager(LoggingConfigurable):'
87 config=self.config,
87 config=self.config,
88 )
88 )
89 km.start_kernel(**kwargs)
89 km.start_kernel(**kwargs)
90 # start the shell channel, needed for graceful restart
91 km.start_channels(shell=True, sub=False, stdin=False, hb=False)
90 self._kernels[kernel_id] = km
92 self._kernels[kernel_id] = km
91 return kernel_id
93 return kernel_id
92
94
@@ -284,7 +286,7 b' class MappingKernelManager(MultiKernelManager):'
284 """Restart a kernel while keeping clients connected."""
286 """Restart a kernel while keeping clients connected."""
285 self._check_kernel_id(kernel_id)
287 self._check_kernel_id(kernel_id)
286 km = self.get_kernel(kernel_id)
288 km = self.get_kernel(kernel_id)
287 km.restart_kernel(now=True)
289 km.restart_kernel()
288 self.log.info("Kernel restarted: %s" % kernel_id)
290 self.log.info("Kernel restarted: %s" % kernel_id)
289 return kernel_id
291 return kernel_id
290
292
General Comments 0
You need to be logged in to leave comments. Login now