namespace Admin.Core.EventBus { /// /// 事件总线 /// 接口 /// public interface IEventBus { /// /// 发布 /// /// 事件模型 void Publish(IntegrationEvent @event); /// /// 订阅 /// /// 约束:事件模型 /// 约束:事件处理器<事件模型> void Subscribe() where T : IntegrationEvent where TH : IIntegrationEventHandler; /// /// 取消订阅 /// /// /// void Unsubscribe() where TH : IIntegrationEventHandler where T : IntegrationEvent; /// /// 动态订阅 /// /// 约束:事件处理器 /// void SubscribeDynamic(string eventName) where TH : IDynamicIntegrationEventHandler; /// /// 动态取消订阅 /// /// /// void UnsubscribeDynamic(string eventName) where TH : IDynamicIntegrationEventHandler; } }