コード例 #1
0
        public async Task Send(ConsumeContext <RoutingSlip> context, IPipe <ConsumeContext <RoutingSlip> > next)
        {
            var timer = Stopwatch.StartNew();

            try
            {
                ExecuteContext <TArguments> executeContext = new HostExecuteContext <TArguments>(HostMetadataCache.Host, _compensateAddress, context);

                if (_log.IsDebugEnabled)
                {
                    _log.DebugFormat("Host: {0} Activity: {1} Executing: {2}", context.ReceiveContext.InputAddress, TypeMetadataCache <TActivity> .ShortName,
                                     executeContext.TrackingNumber);
                }

                await Task.Yield();

                await _activityFactory.Execute(executeContext, _executePipe).ConfigureAwait(false);

                await context.NotifyConsumed(timer.Elapsed, TypeMetadataCache <TActivity> .ShortName).ConfigureAwait(false);

                await next.Send(context).ConfigureAwait(false);
            }
            catch (Exception ex)
            {
                await context.NotifyFaulted(timer.Elapsed, TypeMetadataCache <TActivity> .ShortName, ex).ConfigureAwait(false);

                throw;
            }
        }
コード例 #2
0
 public Task Execute(ExecuteContext <TArguments> context, IPipe <ExecuteActivityContext <TActivity, TArguments> > next)
 {
     return(_executeFactory.Execute(context, next));
 }
コード例 #3
0
 public Task <ResultContext <ExecutionResult> > Execute(ExecuteContext <TArguments> context,
                                                        IRequestPipe <ExecuteActivityContext <TActivity, TArguments>, ExecutionResult> next)
 {
     return(_factory.Execute(context, next));
 }