Refactor/Add CQRS dispatcher caching and refactor handler registration#228
Merged
GeWuYou merged 4 commits intoApr 16, 2026
Conversation
- 实现CqrsHandlerRegistrar类,支持扫描并注册CQRS请求/通知/流式处理器 - 添加源码生成注册器优先策略,减少冷启动时的反射开销 - 实现运行时反射扫描回退机制,确保处理器注册的完整性 - 添加CqrsReflectionFallbackAttribute特性,标记需要运行时补充扫描的程序集 - 创建完整的单元测试套件,验证处理器注册顺序与容错行为 - 实现CqrsHandlerRegistryGenerator源码生成器,自动生成处理器注册代码 - 添加详细的日志记录与诊断功能,便于调试注册过程 - 实现类型安全的处理器映射验证与重复注册检测机制
- 实现GFramework自有CQRS运行时分发器,支持请求/通知/流式请求处理 - 添加进程级缓存机制优化反射调用性能,包括请求、通知、流水线调用委托缓存 - 重构CqrsHandlerRegistrar使用ReflectionFallbackMetadata替代字符串类型名 - 引入CqrsReflectionFallbackAttribute支持运行时补充反射扫描的处理器类型 - 添加完整的CQRS处理器注册单元测试,验证有序执行和容错行为 - 修复MicrosoftDiContainer中异常消息的格式化空白问题 - 实现上下文感知处理器的CQRS分发上下文注入功能
- 在 CqrsDispatcher 中添加 Concurrent 包引用以支持线程安全操作 - 在全局引用文件中增加 Concurrent 包引用,统一并发编程支持 - 为后续的并发处理逻辑改进奠定基础架构支持
- 实现 CqrsDispatcher 类,支持请求/通知/流式请求的分发处理 - 添加进程级缓存机制,优化热路径中的反射和类型构造性能 - 实现上下文感知处理器的 CQRS 分发上下文注入功能 - 开发 CqrsHandlerRegistryGenerator 源代码生成器,减少运行时反射扫描 - 添加完整的单元测试验证缓存机制和服务类型注册功能 - 支持管道行为链处理和异步流式请求响应模式
Contributor
📝 Walkthrough总体概览此PR为GFramework CQRS框架引入了多项性能优化和功能增强:添加了进程级别的缓存机制以避免重复的泛型类型构造,增强了 变更清单
预计代码审查工作量🎯 4 (复杂) | ⏱️ ~60 分钟 可能相关的PR
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
ba6a358
into
refactor/cqrs-architecture-decoupling
7 checks passed
This was referenced Apr 16, 2026
Merged
This was referenced May 10, 2026
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 by CodeRabbit
发布说明
新功能
测试