private async Task ExecuteStepAsync(IStep step, CancellationToken token) { if (step is IStep <T> stepGeneric) { stepGeneric.Context = this.context; } var dt = DateTime.UtcNow; if (step.CanProcess()) { if (step.IsAsync()) { await step.ProcessAsync(token); } else { step.Process(); } var tt = (DateTime.UtcNow - dt).TotalMilliseconds; step.WasFired = true; step.TimeTaken = tt; TakeStats(step); } }
private void ExecuteStep(IStep step) { if (step is IStep <T> stepGeneric) { stepGeneric.Context = this.context; } if (step.CanProcess()) { var dt = DateTime.UtcNow; if (step.IsAsync()) { throw new NotSupportedException("Use IterateAllAsync method"); } else { step.Process(); } var tt = (DateTime.UtcNow - dt).TotalMilliseconds; step.WasFired = true; step.TimeTaken = tt; TakeStats(step); } }