EXP: Attempt to run ViewListener inside a thread #473
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.
This is an experiment to see what happens when we try and use threads in glue-jupyter. This PR is trying to solve the issue mentioned in #472, specifically that:
would not show any image until after the sleep, because the callback from the
ViewListener
is not executed until then. I naively thought that doing something like in this PR would help - setting up and running theViewListener
inside a thread, but this does not help - the_on_view_change
method is still only called after the rest of the cell has run.Full example to try out this PR, avoiding sleep in case it behaves in a special way with respect to threads:
@maartenbreddels - do you understand what might be going on and why this does not work?