Net Fx 4.0 Direct
// Stage 2: Data Transformation public class TransformationStage : IPipelineStage<WorkItem, WorkItem> { public string StageName => "Transformation";
public async Task<WorkItem> ProcessAsync(WorkItem input, CancellationToken token) { if (!input.IsValid) return input; net fx 4.0
// Pipeline stage interface public interface IPipelineStage<TInput, TOutput> { Task<TOutput> ProcessAsync(TInput input, CancellationToken token); string StageName { get; } } { public string StageName =>
public async Task<WorkItem> ProcessAsync(WorkItem input, CancellationToken token) { if (!input.IsValid) return input; public async Task<
public ParallelPipelineProcessor(int parallelismLevel = 3) { _stages = new List<IPipelineStage<WorkItem, WorkItem>> { new ValidationStage(), new TransformationStage(), new EnrichmentStage() }; _parallelismLevel = parallelismLevel; }