Summary
Add progress + cancellation support to the batch primitives.
Motivation
Batch operations need to report rich progress and abort not only on request but also fail-fast when a non-TryEach delegate throws.
Scope
2.7.1 Cancellation — Fail-Fast
- If a non-TryEach delegate throws, the library signals cancellation to the remaining tasks via an internal
CancellationTokenSource, preventing wasted work whose results will be discarded.
- External
CancellationToken from the caller is honored.
2.7.2 Progress reporting
IProgress<T> integration returning a rich ExecutionProgress, not just 0-100%:
public record ExecutionProgress(
int CompletedCount,
int TotalCount,
int FailedCount,
TimeSpan ElapsedTime
);
Design Expectations
- Progress is rich, not a bare percentage.
- Fail-fast only applies to throw-style (non-TryEach) execution.
- Composes with concurrency/map primitives.
Acceptance Criteria
Non-Goals
- No retry policy (Polly adapter).
- No partial-success aggregation (TryEach covers single failures without aborting the whole).
Summary
Add progress + cancellation support to the batch primitives.
Motivation
Batch operations need to report rich progress and abort not only on request but also fail-fast when a non-TryEach delegate throws.
Scope
2.7.1 Cancellation — Fail-Fast
CancellationTokenSource, preventing wasted work whose results will be discarded.CancellationTokenfrom the caller is honored.2.7.2 Progress reporting
IProgress<T>integration returning a richExecutionProgress, not just 0-100%:ExecutionProgressrecord.CancellationTokenSourcecascade on first error (non-TryEach).CancellationTokenhonored throughout.IProgress<T>.Design Expectations
Acceptance Criteria
CancellationTokenstops the batch promptly.Non-Goals