๐ WAYPOINT LESSON
Checkpoint โ The Data Processing Pipeline
โญโญ intermediateโณ 24 min read๐ Lesson 109 of 265
Build a multi-stage lazy pipeline with observable laziness, early termination, and bounded memory behavior.
The gate (mini-build)
A text-processing pipeline over a fixed in-memory "log":
ParseLines(IEnumerable<string> lines)โ yields(int Level, string Msg)for lines shaped"INFO|started"/"WARN|disk".FilterLevel(IEnumerable<(int, string)>, int minLevel)โ yields entries with Level >= minLevel.Format(IEnumerable<(int, string)>)โ yields"[LVL] msg"strings.CountingSourceโ a minimalIEnumerable<string>that counts how many lines were actually read (its enumerator increments on every MoveNext that yields).Run(IEnumerable<string> lines, int minLevel, int maxResults)composes 1โ2โ3 and returns at most maxResults formatted entries โ and stops PULLING from the source the moment the cap is reached (observable: a CountingSource passed to Run reports how many lines were read; a capped run must not drain the source).