namespace EventBus
{
    /// <summary>
    /// 事件句柄
    /// </summary>
    /// <typeparam name="TData">事件发布数据类型</typeparam>
    public interface IEventData<TData> : IBaseEventData
    {
        /// <summary>
        /// 发布同步事件
        /// </summary>
        /// <param name="sender">事件源</param>
        /// <param name="data">事件数据</param>
        /// <param name="properties">筛选器</param>
        void Publish(object sender, TData data, Properties? properties = null);
        /// <summary>
        /// 发布异步事件
        /// </summary>
        Task PublishAsync(object sender, TData data, Properties? properties = null);
        /// <summary>
        /// 订阅事件
        /// </summary>
        /// <param name="action">事件处理函数</param>
        /// <param name="properties">筛选器</param>
        Guid Subscrip(Action<object, EventArgs<TData>> action, Properties? properties = null);


    }
}