Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce parallel send_message API #871

Merged
merged 8 commits into from
Feb 5, 2025
Merged

Conversation

cBournhonesque
Copy link
Owner

Update the Message/Trigger API:

  • previously we had access to ConnectionManager.send_message/send_trigger, which had the benefit of only requiring a reference to the message, but limited parallelism
  • this PR adds another way (inspired by replicon) to send message: you can just buffer them to Events<ClientSendMessage<M>> or Events<ServerSendMessage<M>>, or call commands.client_trigger() or commands.server_trigger(), however you need to provide an owned version of the message

I had some trouble with the API so I removed the ConnectionManager.send_trigger event.

This PR also renames some things:
-> MessageEvent becomes ClientMessageEvent or ServerMessageEvent
-> app.register_event() becomes app.register_trigger(), and is specifically for replicated triggers, not messages

@cBournhonesque cBournhonesque merged commit f955d31 into main Feb 5, 2025
2 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant