Skip to content

Allow a CommWidget to send and receive binary messages#39

Open
davidbrochart wants to merge 2 commits intoQuantStack:mainfrom
davidbrochart:messages
Open

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

Conversation

@davidbrochart
Copy link
Copy Markdown
Member

No description provided.

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 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.

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