File tree Expand file tree Collapse file tree 2 files changed +26
-17
lines changed Expand file tree Collapse file tree 2 files changed +26
-17
lines changed Original file line number Diff line number Diff line change @@ -110,24 +110,25 @@ export class VariableInspectionHandler extends AbstractHandler {
110110 } ) ;
111111 } ) ;
112112
113- this . _connector . kernelRestarted . connect (
114- ( sender , kernelReady : Promise < void > ) => {
115- const title : IVariableInspector . IVariableTitle = {
116- contextName : '<b>Restarting kernel...</b> '
117- } ;
118- this . _inspected . emit ( {
119- title : title ,
120- payload : [ ]
121- } as IVariableInspector . IVariableInspectorUpdate ) ;
122-
123- this . _ready = kernelReady . then ( ( ) => {
124- this . _initOnKernel ( ) . then ( ( msg : KernelMessage . IExecuteReplyMsg ) => {
125- this . _connector . iopubMessage . connect ( this . _queryCall ) ;
126- this . performInspection ( ) ;
127- } ) ;
113+ const onKernelReset = ( sender : unknown , kernelReady : Promise < void > ) => {
114+ const title : IVariableInspector . IVariableTitle = {
115+ contextName : '<b>Waiting for kernel...</b> '
116+ } ;
117+ this . _inspected . emit ( {
118+ title : title ,
119+ payload : [ ]
120+ } as IVariableInspector . IVariableInspectorUpdate ) ;
121+
122+ this . _ready = kernelReady . then ( ( ) => {
123+ this . _initOnKernel ( ) . then ( ( msg : KernelMessage . IExecuteReplyMsg ) => {
124+ this . _connector . iopubMessage . connect ( this . _queryCall ) ;
125+ this . performInspection ( ) ;
128126 } ) ;
129- }
130- ) ;
127+ } ) ;
128+ } ;
129+
130+ this . _connector . kernelRestarted . connect ( onKernelReset ) ;
131+ this . _connector . kernelChanged . connect ( onKernelReset ) ;
131132 }
132133
133134 get id ( ) : string {
Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ import { ISignal, Signal } from '@lumino/signaling';
1616 */
1717export class KernelConnector {
1818 private _session : ISessionContext ;
19+ private _kernelChanged = new Signal < KernelConnector , Promise < void > > ( this ) ;
1920 private _kernelRestarted = new Signal < this, Promise < void > > ( this ) ;
2021
2122 constructor ( options : KernelConnector . IOptions ) {
@@ -32,6 +33,13 @@ export class KernelConnector {
3233 }
3334 }
3435 ) ;
36+ this . _session . kernelChanged . connect ( ( ) =>
37+ this . _kernelChanged . emit ( this . _session . ready )
38+ ) ;
39+ }
40+
41+ get kernelChanged ( ) : ISignal < KernelConnector , Promise < void > > {
42+ return this . _kernelChanged ;
3543 }
3644
3745 get kernelRestarted ( ) : ISignal < KernelConnector , Promise < void > > {
You can’t perform that action at this time.
0 commit comments