bevy_replicon icon indicating copy to clipboard operation
bevy_replicon copied to clipboard

Use a single system for events

Open Shatur opened this issue 1 year ago • 2 comments

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.

Shatur avatar May 01 '24 16:05 Shatur

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.

notmd avatar May 12 '24 20:05 notmd

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.

Shatur avatar May 12 '24 21:05 Shatur