Conversation
- Add ILoggerFactory to EventTypeRegistry for debug logging of registrations. - Replace internal event registry with dictionaries for O(1) lookups. - Avoid redundant assembly scans by sharing initialization logic. - Simplify GetTypeByName/GetNameByType; remove EventTypeEntry. - Supplement event type/name mappings with handler-discovered types. - Update DI registration to inject ILoggerFactory.
Contributor
There was a problem hiding this comment.
Pull request overview
Refactors EventTypeRegistry to improve event type/name resolution performance and to add debug logging around type/handler registration within the EventBus core.
Changes:
- Inject
ILoggerFactoryintoEventTypeRegistryand add debug logs for discovered handlers and event message types. - Replace the previous event registry structure with name↔type dictionaries for O(1) lookups and shared initialization.
- Update DI registration to pass
ILoggerFactorywhen constructingEventTypeRegistry.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
src/Arcturus.EventBus/ServiceExtensions.cs |
Updates DI registration to construct EventTypeRegistry with an ILoggerFactory. |
src/Arcturus.EventBus/EventTypeRegistry.cs |
Reworks internal storage to dictionaries and adds debug logging during registry construction. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
ILoggerFactory and ILogger<EventTypeRegistry> are now optional dependencies in EventTypeRegistry, allowing construction without a logger. Logging statements use structured logging instead of string interpolation. DI registration uses GetService to make the logger optional.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary & Motivation
A brief description of the changes in this pull request explaining why these changes are necessary. Please delete this paragraph.
Checklist