Repository navigation
refactor(actor)!: Resolve and cache handlers by message type - #953
Merged
Merged
Conversation
Resolve handlers through the message class’s MRO, giving specific handlers precedence over catch-all handlers regardless of registration order. Support later-loaded and deeper subclasses, and use class keys to avoid name collisions. Cache successful resolutions and clear the cache on every registration. BREAKING CHANGE: Remove `include_subclasses` argument to `State.add_handler` method. Inheritance matching is unconditional. `State.handlers` now uses class objects instead of class names as keys.
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #953 +/- ##
==========================================
+ Coverage 86.72% 86.77% +0.04%
==========================================
Files 81 81
Lines 2817 2827 +10
==========================================
+ Hits 2443 2453 +10
Misses 374 374
🚀 New features to boost your workflow:
|
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.



PR overview:
Staterelated tests intotest_state.py.Breaking changes:
include_subclassesfromState.add_handler(); inheritance matching is now unconditional.State.handlers.State.dispatch_message()toState.handle_message().