Skip to content

Update send_events system to not use World directly#25

Merged
AS1100K merged 2 commits intomainfrom
better-send-events-system
May 9, 2025
Merged

Update send_events system to not use World directly#25
AS1100K merged 2 commits intomainfrom
better-send-events-system

Conversation

@AS1100K
Copy link
Copy Markdown
Owner

@AS1100K AS1100K commented Mar 26, 2025

Trying to make send_events system better in performance by not using world directly in the system

TODOs

  • Break send_events system into two parts, one for bot and rich_presence modules.
    This would make the send_events system work on full feature without adding both the modules and registering their events
  • Add benchmarks to verify it is improving performance

@AS1100K AS1100K marked this pull request as ready for review April 28, 2025 17:48
Copilot AI review requested due to automatic review settings April 28, 2025 17:48
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors the send_events system to decouple it from direct World usage and splits its responsibilities between the bot and rich_presence modules. Key changes include:

  • Introducing generic ChannelRes with typed event collections.
  • Adjusting macros and system registration so that send_events are triggered via resources instead of direct world access.
  • Updating both the rich_presence and bot modules to use the new event collection types and send_events functions.

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.

Show a summary per file
File Description
src/rich_presence/mod.rs Replaces direct World access with a ChannelRes resource and registers new systems for sending events.
src/rich_presence/event_handlers.rs Updates event handler macro calls to use the new EventCollectionRichPresence.
src/events.rs Splits event collections for bot and rich_presence by revising macro calls and creation patterns.
src/common.rs Modifies macros to accept an additional parameter for function naming and sends events via new channel.
src/channel.rs Removes deprecated plugin implementations and introduces a generic ChannelRes type.
src/bot/mod.rs and src/bot/handle.rs Updates bot event handling to use EventCollectionBot and the new send_events_bot function.
Cargo.toml Adds the pastey dependency required for the updated macro implementation.

@AS1100K AS1100K merged commit 9d9bb44 into main May 9, 2025
9 checks passed
@AS1100K AS1100K deleted the better-send-events-system branch May 9, 2025 07:27
@AS1100K AS1100K mentioned this pull request May 11, 2025
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.

2 participants