zeroframework/BuildingBlocks/EventBus/ZeroFramework.EventBus/Abstractions/IEventBus.cs

18 lines
631 B
C#
Raw Normal View History

2023-12-05 09:22:48 +00:00
using ZeroFramework.EventBus.Events;
namespace ZeroFramework.EventBus.Abstractions
{
public interface IEventBus
{
Task PublishAsync(IntegrationEvent @event, CancellationToken cancellationToken = default);
void Subscribe<T, TH>() where T : IntegrationEvent where TH : IIntegrationEventHandler<T>;
void Unsubscribe<T, TH>() where T : IntegrationEvent where TH : IIntegrationEventHandler<T>;
void SubscribeDynamic<TH>(string eventName) where TH : IDynamicIntegrationEventHandler;
void UnsubscribeDynamic<TH>(string eventName) where TH : IDynamicIntegrationEventHandler;
}
}