-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
[dotnet] [bidi] Refactor CommandInfo and EventInfo to structs #17080
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
[dotnet] [bidi] Refactor CommandInfo and EventInfo to structs #17080
Conversation
PR TypeEnhancement Description
|
| Relevant files | |||
|---|---|---|---|
| Enhancement |
|
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
||||||||||||||||||||||||
PR Code Suggestions ✨Explore these optional code suggestions:
|
|||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Refactors the internal BiDi Broker bookkeeping types to reduce allocations and simplify the representation of pending commands/events by using record struct values instead of tuples/classes.
Changes:
- Replaced the pending event tuple channel with a strongly-typed
EventInforecord struct channel. - Replaced
CommandInforeference type with areadonly record struct, removing the redundant stored command id (dictionary key already provides it). - Updated enqueue/dequeue logic to use the new struct types.
Improve performance for commands/events internally.
💥 What does this PR do?
This pull request refactors the internal event and command handling logic in the
Brokerclass to simplify data structures and improve type safety. The main changes involve replacing tuple-based and class-based representations withrecord structtypes for commands and events, and updating related logic accordingly.🔄 Types of changes