/// <summary>
        /// 接受事件代理
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="data"></param>
        /// <returns></returns>
        public override async Task HandleInvoke <T>(EventProcessPacker <T> data)
        {
            //构造一个临时的IOC生命周期
            using var scope = lifetimeScope.BeginLifetimeScope();
            //通过Tservice构造委托对应的服务实例
            var serviceInstance = scope.Resolve <Tservice>() as EventProcessHandlerBase;

            //传递管道状态给该实例
            serviceInstance.processCache = data.processCache;
            //传递实例及事件给动态代理,执行其委托
            await method(serviceInstance as Timpl, data.Input as TEvent);

            //通知流程管理器管道可以执行下一步
            serviceInstance.processCache.AutoResetEvent.Set();
        }
Exemple #2
0
 public abstract Task HandleInvoke <T>(EventProcessPacker <T> data) where T : EventProcessBase;