private async ValueTask ExecuteStep(IValueTaskStep step, T context, List <StepStat> stats, CancellationToken token)
        {
            if (step is IValueTaskStep <T> stepWithCtx)
            {
                stepWithCtx.Context = context;
            }

            if (step.CanProcess())
            {
                var dt = DateTime.UtcNow;
                await step.Process(token);

                var tt = (DateTime.UtcNow - dt).TotalMilliseconds;
                step.WasFired  = true;
                step.TimeTaken = tt;
                stats.Add(StepStat.CreateFromStep(step));
            }
        }
Exemplo n.º 2
0
 protected void TakeStats(IStep step)
 {
     this.stats.Add(StepStat.CreateFromStep(step));
 }