src/Coast.Core/EventBus/IEventBusSubscriptionsManager.cs

(完整代码) 1KB

namespace Coast.Core.EventBus
{
    using System;
    using System.Collections.Generic;
    using static Coast.Core.EventBus.InMemoryEventBusSubscriptionsManager;

    public interface IEventBusSubscriptionsManager
    {
        bool IsEmpty { get; }

        event EventHandler<string> OnEventRemoved;

        void AddSubscription<T, TH>()
           where T : EventRequestBody
           where TH : ISagaHandler<T>;

        void RemoveSubscription<T, TH>()
             where TH : ISagaHandler<T>
             where T : EventRequestBody;

        void AddSubscription<TH>(string eventName)
            where TH : ISagaHandler;

        void RemoveSubscription<TH>(string eventName)
            where TH : ISagaHandler;

        bool HasSubscriptionsForEvent<T>() where T : EventRequestBody;

        bool HasSubscriptionsForEvent(string eventName);

        Type GetEventTypeByName(string eventName);

        void Clear();

        IEnumerable<SubscriptionInfo> GetHandlersForEvent<T>() where T : EventRequestBody;

        IEnumerable<SubscriptionInfo> GetHandlersForEvent(string eventName);

        string GetEventKey<T>();
    }
}

24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明

AI 解读

登录后可用,每次 10 积分,解读结果公开显示在下面。

还没有人解读过这个文件。