Skip to content

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

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

Allow a CommWidget to send and receive binary messages#39
davidbrochart wants to merge 2 commits into
QuantStack:mainfrom
davidbrochart:messages

Conversation

@davidbrochart

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.

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.

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.

注册 for free to join this conversation on GitHub. Already have an account? 登录 to comment

标签

enhancement 新建 feature or request

项目

None yet

Development

Successfully merging this pull request may close these issues.

2 participants