##// END OF EJS Templates
restart channels on kernel restart...
MinRK -
Show More
@@ -104,8 +104,6 b' var IPython = (function (IPython) {'
104 this.ws_url = json.ws_url;
104 this.ws_url = json.ws_url;
105 this.kernel_url = this.base_url + "/" + this.kernel_id;
105 this.kernel_url = this.base_url + "/" + this.kernel_id;
106 this.start_channels();
106 this.start_channels();
107 this.shell_channel.onmessage = $.proxy(this._handle_shell_reply,this);
108 this.iopub_channel.onmessage = $.proxy(this._handle_iopub_reply,this);
109 $([IPython.events]).trigger('status_started.Kernel', {kernel: this});
107 $([IPython.events]).trigger('status_started.Kernel', {kernel: this});
110 };
108 };
111
109
@@ -165,6 +163,8 b' var IPython = (function (IPython) {'
165 that.iopub_channel.onclose = ws_closed_late;
163 that.iopub_channel.onclose = ws_closed_late;
166 }
164 }
167 }, 1000);
165 }, 1000);
166 this.shell_channel.onmessage = $.proxy(this._handle_shell_reply,this);
167 this.iopub_channel.onmessage = $.proxy(this._handle_iopub_reply,this);
168 };
168 };
169
169
170 /**
170 /**
@@ -419,6 +419,9 b' var IPython = (function (IPython) {'
419 } else if (content.execution_state === 'idle') {
419 } else if (content.execution_state === 'idle') {
420 $([IPython.events]).trigger('status_idle.Kernel', {kernel: this});
420 $([IPython.events]).trigger('status_idle.Kernel', {kernel: this});
421 } else if (content.execution_state === 'restarting') {
421 } else if (content.execution_state === 'restarting') {
422 // restart channels if kernel restarts
423 // avoids unlikely corrupted connection
424 setTimeout($.proxy(this.start_channels, this), 500);
422 $([IPython.events]).trigger('status_restarting.Kernel', {kernel: this});
425 $([IPython.events]).trigger('status_restarting.Kernel', {kernel: this});
423 } else if (content.execution_state === 'dead') {
426 } else if (content.execution_state === 'dead') {
424 this.stop_channels();
427 this.stop_channels();
General Comments 0
You need to be logged in to leave comments. Login now