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; } }
public Task Execute(ExecuteContext <TArguments> context, IPipe <ExecuteActivityContext <TActivity, TArguments> > next) { return(_executeFactory.Execute(context, next)); }
public Task <ResultContext <ExecutionResult> > Execute(ExecuteContext <TArguments> context, IRequestPipe <ExecuteActivityContext <TActivity, TArguments>, ExecutionResult> next) { return(_factory.Execute(context, next)); }