๐ WAYPOINT LESSON
Checkpoint โ The Parallel Fetcher
โญโญ intermediateโณ 25 min read๐ Lesson 116 of 265
Combine fan-out, per-call timeouts, cooperative cancellation, and honest failure aggregation into one resilient pipeline.
The gate (mini-build)
A resilient concurrent fetch pipeline over CjFlaky.FetchAsync(key, delayMs, ct) (provided in your starter code; slow* keys hang for 5 s):
FetchAll(IEnumerable<string> keys, TimeSpan perCall, CancellationToken ct)โ starts EVERY simulated fetch at once (fan-out).- Each call is time-boxed with
perCallโ a hung backend is ABANDONED, not waited out. Outcomes:"key=ok"or"key=timeout". - Caller cancellation aborts immediately with
OperationCanceledExceptioneven if fetches are still pending. Report(results)formats results sorted by key:"a=ok|b=timeout".
Tests observe timing generously (< 1 s for a 5 s hang) โ the discipline is structural: start-all-then-await, WaitAsync per call, token through.