// Copyright (c) 2025-2026 GeWuYou
// SPDX-License-Identifier: Apache-2.0
using GFramework.Cqrs.Abstractions.Cqrs;
namespace GFramework.Cqrs.Notification;
///
/// 通过内部回调桥接 dispatcher 执行逻辑的通知发布上下文。
///
/// 通知类型。
/// 执行单个处理器所需的内部状态类型。
internal sealed class DelegatingNotificationPublishContext : NotificationPublishContext
where TNotification : INotification
{
private readonly NotificationHandlerExecutor _handlerExecutor;
private readonly TState _state;
///
/// 初始化一个委托驱动的通知发布上下文。
///
/// 当前通知。
/// 当前发布调用已解析到的处理器集合。
/// 执行处理器时需要的内部状态。
/// 执行单个处理器时调用的内部回调。
///
/// 为 。
///
internal DelegatingNotificationPublishContext(
TNotification notification,
IReadOnlyList