Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions packages/voila/src/manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,11 @@ if (typeof window !== 'undefined' && typeof window.define !== 'undefined') {

const WIDGET_MIMETYPE = 'application/vnd.jupyter.widget-view+json';

/**
* Time (in ms) after which we consider the control comm target not responding.
*/
export const CONTROL_COMM_TIMEOUT = 4000;

/**
* A custom widget manager to render widgets with Voila
*/
Expand Down Expand Up @@ -238,6 +243,12 @@ export class WidgetManager extends JupyterLabManager {

// Send a states request msg
initComm.send({ method: 'request_states' }, {});

// Reject if we didn't get a response in time
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add TODO here to remove this code in the future?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you referring to my comment?

Once we reuse the base manager, we can get rid of this code in Voila.

The entire method _build_models will be removed once jupyter-widgets/ipywidgets#3335 gets released.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for clarifying!

setTimeout(
() => reject('Control comm did not respond in time'),
CONTROL_COMM_TIMEOUT
);
});
} catch (error) {
console.warn(
Expand Down