Skip to content

Conversation

davidbrochart
Copy link
Member

No description provided.

if reply is not None:
self._comm.send(buffers=[reply])
if message[1] == YSyncMessageType.SYNC_STEP2:
self._ydoc.observe(self._send)
elif message_type == 2:
Copy link
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
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