FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Allow a `CommWidget` to send and receive binary messages by davidbrochart · Pull Request #39 · QuantStack/ypywidgets · GitHub

Repository navigation

Allow a CommWidget to send and receive binary messages - #39

Open
davidbrochart wants to merge 2 commits into
QuantStack:mainfrom
davidbrochart:messages
Open

davidbrochart wants to merge 2 commits into
QuantStack:mainfrom
davidbrochart:messages

Conversation

Copy link
Copy Markdown
Member

No description provided.

Comment thread src/ypywidgets/comm.py
self._comm.send(buffers=[reply])
if message[1] == YSyncMessageType.SYNC_STEP2:
self._ydoc.observe(self._send)
elif message_type == 2:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Maybe an ENUM for this value?

Comment thread src/ypywidgets/comm.py
Comment on lines +80 to +81
def on_receive(self, callback: Callable[[bytes], None]):
self._on_receive = callback

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Is a setter enough? Not sure there is a use case for this, but I generally prefer allowing registering multiple handlers for the on message event.

This branch has not been deployed

No deployments
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

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL