Mnt direct call draw idle [WIP] #4849
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Built on top of #4738
@mdehoon
When I went to implement this I grew confused as to where the canvas knowing it was stale would fit in. Isn't the call to
draw_idle
the message to the canvas that it is stale?There were also some issues with the first
draw_idle
going out before all of the objects had finished building them selves addingstale
to the canvas in the naive way because callbacks in python get executed synchronously.I did re-work how the stale state gets propagated and (I think) greatly simplified it by adding a dedicated callback.
As-is this has an issue with
__init__
order of operations with the nbagg backend which I don't have time to debug tonight.I am worried about how this method will interact with nbagg which has a js side event loop running in the browser and then call backs listening to comms on the python side. By hooking into the IPython callbacks we get to leverage their understanding of how to manage things.