Exemple #1
0
        /// <summary> 发布 </summary>
        /// <param name="eventBus"></param>
        /// <param name="event">事件</param>
        /// <param name="option"></param>
        /// <param name="delay"></param>
        public static Task Publish(this IEventBus eventBus, DEvent @event, TimeSpan delay)
        {
            var key = @event.GetType().GetRouteKey();

            return(eventBus.Publish(key, @event, new PublishOption {
                Delay = delay
            }));
        }
Exemple #2
0
        /// <summary> 发布 </summary>
        /// <param name="eventBus"></param>
        /// <param name="event">事件</param>
        /// <param name="option"></param>
        public static Task Publish(this IEventBus eventBus, DEvent @event, PublishOption option = null)
        {
            var key = @event.GetType().GetRouteKey();

            return(eventBus.Publish(key, @event, option));
        }