File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
notebook/static/services/kernels Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -141,6 +141,7 @@ define([
141141 this . register_iopub_handler ( 'status' , $ . proxy ( this . _handle_status_message , this ) ) ;
142142 this . register_iopub_handler ( 'clear_output' , $ . proxy ( this . _handle_clear_output , this ) ) ;
143143 this . register_iopub_handler ( 'execute_input' , $ . proxy ( this . _handle_input_message , this ) ) ;
144+ this . register_iopub_handler ( 'shutdown_reply' , $ . proxy ( this . _handle_shutdown_message , this ) ) ;
144145
145146 for ( var i = 0 ; i < output_msg_types . length ; i ++ ) {
146147 this . register_iopub_handler ( output_msg_types [ i ] , $ . proxy ( this . _handle_output_message , this ) ) ;
@@ -1212,6 +1213,19 @@ define([
12121213 }
12131214 } ;
12141215
1216+
1217+ /**
1218+ * Handle a kernel shutdown message
1219+ * @function _handle_shutdown_message
1220+ */
1221+ Kernel . prototype . _handle_shutdown_message = function ( msg ) {
1222+ if ( ! msg . content . restart ) {
1223+ this . events . trigger ( 'kernel_dead.Kernel' , { kernel : this } ) ;
1224+ this . _kernel_dead ( ) ;
1225+ }
1226+ }
1227+
1228+
12151229 /**
12161230 * Dispatch IOPub messages to respective handlers. Each message
12171231 * type should have a handler.
You can’t perform that action at this time.
0 commit comments