/// <summary>
        ///
        /// </summary>
        /// <param name="tip"></param>
        private static void CanceleReverse(EventAttribute tip)
        {
            if (!tip.IsEnabled)
            {
                return;
            }

            var reverseName = EventUtil.GetReverse(tip.Name);

            EventPortal.Cancel(reverseName);
        }
        /// <summary>
        /// 订阅回逆
        /// </summary>
        /// <param name="tip"></param>
        private static void SubscribeReverse(EventAttribute tip)
        {
            if (!tip.IsEnabled)
            {
                return;
            }

            var reverseName = EventUtil.GetReverse(tip.Name);

            EventPortal.Subscribe(reverseName, ReverseEventHandler.Instance);
        }
Exemple #3
0
        private static void ReverseRemoteEvent(EventEntry entry, dynamic identity, DTObject args)
        {
            entry.Status = EventStatus.Reversing;

            //调用远程事件时会创建一个接收结果的临时队列,有可能该临时队列没有被删除,所以需要在回逆的时候处理一次
            EventTrigger.CleanupRemoteEventResult(entry.EventName, entry.EventId);

            //发布“回逆事件”的事件
            var reverseEventName = EventUtil.GetReverse(entry.EventName);

            EventPortal.Publish(reverseEventName, entry.GetRemotable(identity, args));
            //注意,与“触发事件”不同,我们不需要等待回逆的结果,只用传递回逆的消息即可
            entry.Status = EventStatus.Reversed;
        }