Use a single system for events
Instead of registering multiple systems, we can use a single system by using custom functions (similar to what we do for components).
This will make the public API simpler and more efficient.
Bevy did a similar optimization recently: https://github.com/bevyengine/bevy/pull/12936 and we can benefit from the provided EventRegistry.
I will try to take this. And will try to fix the 1 channel per event as well. This is really a foot gun for us and also limits the amount of events the app can have.
I will try to take this.
Great, I will be happy to review it. Let me know if you have any questions about the implementation.
And will try to fix the 1 channel per event as well.
~We need control over reliability guarantee. So maybe 3 channels for each event type.~ I think I rushed a bit with this suggestion. Having a separate channel for each event is better for bandwith. When messaging backend sends a message, it includes the channel ID into it. And if we use only 3 channels for each event type, we will also need to include event ID. So let's keep separate channel for each event.