File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -70,6 +70,11 @@ if (typeof window !== 'undefined' && typeof window.define !== 'undefined') {
7070
7171const WIDGET_MIMETYPE = 'application/vnd.jupyter.widget-view+json' ;
7272
73+ /**
74+ * Time (in ms) after which we consider the control comm target not responding.
75+ */
76+ export const CONTROL_COMM_TIMEOUT = 4000 ;
77+
7378/**
7479 * A custom widget manager to render widgets with Voila
7580 */
@@ -238,6 +243,12 @@ export class WidgetManager extends JupyterLabManager {
238243
239244 // Send a states request msg
240245 initComm . send ( { method : 'request_states' } , { } ) ;
246+
247+ // Reject if we didn't get a response in time
248+ setTimeout (
249+ ( ) => reject ( 'Control comm did not respond in time' ) ,
250+ CONTROL_COMM_TIMEOUT
251+ ) ;
241252 } ) ;
242253 } catch ( error ) {
243254 console . warn (
You can’t perform that action at this time.
0 commit comments