mirror of
https://github.com/GeWuYou/GFramework.git
synced 2026-05-07 00:39:00 +08:00
- 优化 CqrsDispatcher 的 request pipeline 路径,按请求类型与行为数量缓存 typed executor 形状并在单次分发中绑定当前 handler 与 behaviors - 补充 dispatcher 缓存回归测试,覆盖 pipeline executor 的首次创建、后续复用与行为顺序稳定
22 lines
790 B
C#
22 lines
790 B
C#
using GFramework.Cqrs.Abstractions.Cqrs;
|
|
|
|
namespace GFramework.Cqrs.Tests.Cqrs;
|
|
|
|
/// <summary>
|
|
/// 为双行为顺序回归提供最终请求处理器。
|
|
/// </summary>
|
|
internal sealed class DispatcherPipelineOrderCacheRequestHandler : IRequestHandler<DispatcherPipelineOrderCacheRequest, int>
|
|
{
|
|
/// <summary>
|
|
/// 记录处理器执行并返回固定结果。
|
|
/// </summary>
|
|
/// <param name="request">当前请求。</param>
|
|
/// <param name="cancellationToken">取消令牌。</param>
|
|
/// <returns>固定整数结果。</returns>
|
|
public ValueTask<int> Handle(DispatcherPipelineOrderCacheRequest request, CancellationToken cancellationToken)
|
|
{
|
|
DispatcherPipelineOrderState.Steps.Add("Handler");
|
|
return ValueTask.FromResult(3);
|
|
}
|
|
}
|