Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CommManager model to handle notebook comms #1171

Merged
merged 8 commits into from
Mar 26, 2020
Merged

Conversation

philippjfr
Copy link
Member

@philippjfr philippjfr commented Mar 20, 2020

In the past to make communication work in notebook backends we had to attach callbacks to all bokeh properties we wanted to monitor. This was extremely inefficient because each of these callbacks is ~100 lines of JS code and a large app might have hundreds or even thousands of properties. In this PR we introduce a CommManager model, this model is added to the Document.roots when rendering in a notebook and registers a Document.on_change callback which will dispatch all the protocol messages that bokeh supports to Python. This means that it will behave identically to the server, simplifying codepaths and ensuring that bokeh models stay synced at all times.

Benefits:

  • We support all bokeh protocol messages
  • Simplifies codepaths (no more difference between comm and server codepaths)
  • Much smaller Javascript output

Copy link
Member

@jbednar jbednar left a comment

Choose a reason for hiding this comment

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

Looks pretty clean!

@philippjfr philippjfr merged commit ac0be10 into master Mar 26, 2020
@philippjfr philippjfr deleted the comm_manager_model branch March 26, 2020 19:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants