Pipeline Processor
Pipeline Processor
Section titled “Pipeline Processor”Build a multi-stage concurrent pipeline with fan-out and fan-in patterns.
Recommended Prerequisites
Complete these exercises first for the best learning experience:
- ○Worker Pool
0/1 completed
Background
Section titled “Background”Pipeline Pattern: Chain processing stages where output of one stage feeds into the next, connected by channels.
Fan-Out: Multiple goroutines read from the same channel to parallelize work.
Fan-In: Multiple channels are merged into one output channel.
Pipelines enable concurrent data processing with clear separation of concerns and efficient resource usage.
Your Task
Section titled “Your Task”Build a 3-stage data processing pipeline:
- Stage 1 (Parse): Parse job data
- Stage 2 (Transform): Transform/process the data (fan-out to 2 workers)
- Stage 3 (Validate): Validate results
- Merge: Combine results from all stage 3 workers
Multi-Stage Concurrent Pipeline
~30 minhard
Implement pipeline with fan-out/fan-in for concurrent processing
Key Concepts
Section titled “Key Concepts”- Pipeline Pattern: Chain stages with channels for concurrent data flow
- Fan-Out: Multiple workers read from same channel to parallelize work
- Fan-In (Merge): Combine multiple channels into one output channel
- Channel Ownership: Each stage owns its output channel and closes it when done
- Composition: Build complex workflows by chaining simple stages