Summary
Add TryEachInContextAsync — a best-effort batch runner that continues processing remaining items when individual ones fail, collecting errors instead of aborting the whole batch.
Goal
Support partial success: keep 995 of 1000 emails when 5 fail, reporting failures at the end rather than halting.
Problem
ExecuteAll/Map propagates the first exception and abandons the rest. For bulk writes/notifications, a single bad address should not discard the remaining legitimate items.
Scope
Design Expectations
- Per-item isolation and events identical to base execution.
- Failures are structural (exception) not state-corrupting.
- Pairs naturally with
MapParallel for bounded best-effort batches.
Acceptance Criteria
Non-Goals
- No retry (resilience lives in the Polly adapter).
- No ordering guarantee (see Ordered/Unordered).
- No automatic partial-failure rollback.
Summary
Add
TryEachInContextAsync— a best-effort batch runner that continues processing remaining items when individual ones fail, collecting errors instead of aborting the whole batch.Goal
Support partial success: keep 995 of 1000 emails when 5 fail, reporting failures at the end rather than halting.
Problem
ExecuteAll/Mappropagates the first exception and abandons the rest. For bulk writes/notifications, a single bad address should not discard the remaining legitimate items.Scope
TryEachInContextAsyncreturning a result object.resultrecord:SuccessCount,FailureCount,HasErrors,Failures({Item, Exception}).CancellationTokento abort between items.Design Expectations
MapParallelfor bounded best-effort batches.Acceptance Criteria
Non-Goals