Creates and register the comm target when it does not exist#698
Merged
Conversation
Member
|
Does it work to re-register the comm target after the fact? import comm
# This creates a dummy callback
comm.create_comm(target_name="foo")
def handle_comm_opened(*args, **kwargs):
# TODO handle comm open from front-end
pass
comm_manager = comm.get_comm_manager()
if comm_manager is not None:
comm_manager.register_target("foo", handle_comm_opened) |
Member
Author
|
It is supposed to work because the registration ends here. However, executing this coe in a single cell results in a kernel crash for another reason (the GIL is not handled correctly). Splitting the code in the two following cells: import comm
# This creates a dummy callback
comm.create_comm(target_name="foo")and def handle_comm_opened(*args, **kwargs):
# TODO handle comm open from front-end
pass
comm_manager = comm.get_comm_manager()
if comm_manager is not None:
comm_manager.register_target("foo", handle_comm_opened)makes it work. The issue seems to come from the call of comm_close received after creating the comm. If we have any python left to execute from the cell, it crashes. I'll investigate and fix that one in a dedicated PR. |
Member
Author
|
Looks like the issue is in xeus itself, so let's release xeus-python to fix the most common issue |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #672