Merge pull request #5593 from levinxo/master

kill notebook its self when server cull idle kernel (new fix)
This commit is contained in:
Zachary Sailer 2020-07-23 13:08:56 -07:00 committed by GitHub
commit 42227e99f9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -141,6 +141,7 @@ define([
this.register_iopub_handler('status', $.proxy(this._handle_status_message, this));
this.register_iopub_handler('clear_output', $.proxy(this._handle_clear_output, this));
this.register_iopub_handler('execute_input', $.proxy(this._handle_input_message, this));
this.register_iopub_handler('shutdown_reply', $.proxy(this._handle_shutdown_message, this));
for (var i=0; i < output_msg_types.length; i++) {
this.register_iopub_handler(output_msg_types[i], $.proxy(this._handle_output_message, this));
@ -1212,6 +1213,19 @@ define([
}
};
/**
* Handle a kernel shutdown message
* @function _handle_shutdown_message
*/
Kernel.prototype._handle_shutdown_message = function (msg) {
if (!msg.content.restart) {
this.events.trigger('kernel_dead.Kernel', {kernel: this});
this._kernel_dead();
}
}
/**
* Dispatch IOPub messages to respective handlers. Each message
* type should have a handler.