feat: BatchTransformerBase for fixed-size batching (#89)#249
Closed
Chris-Wolfgang wants to merge 2 commits into
Closed
feat: BatchTransformerBase for fixed-size batching (#89)#249Chris-Wolfgang wants to merge 2 commits into
Chris-Wolfgang wants to merge 2 commits into
Conversation
BatchTransformerBase<TSource, TProgress> : TransformerBase<TSource, IReadOnlyList<TSource>, TProgress> accumulates source items into fixed-size batches and yields each as IReadOnlyList<TSource>, flushing the trailing partial batch when the source completes (the classic bulk-op bug, solved once). - Configurable BatchSize (default 100, validated >= 1). - Sealed override of TransformWorkerAsync so the batching contract can't drift; derived classes only supply CreateProgressReport. - CurrentItemCount counts batches yielded (the downstream unit of work), not input items. Cancellation observed while enumerating the source. MINOR (additive public API). PublicAPI.Shipped.txt regenerated. Verified: full Release build clean across all TFMs (0 warnings); 246 tests pass (7 new: even/uneven/empty/partial batching, batch counting, BatchSize validation). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Owner
Author
|
Closing — superseded by |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
BatchTransformerBase<TSource, TProgress>for fixed-size batch accumulation. Closes #89.Stacked on #248 (base
feature/async-disposable, the tip of the 0.14.0 base-class chain) so its regenerated baseline includes the full release surface.What
BatchTransformerBase<TSource, TProgress> : TransformerBase<TSource, IReadOnlyList<TSource>, TProgress>accumulates source items into batches and yields each asIReadOnlyList<TSource>, flushing the trailing partial batch when the source completes — the bug everyone re-introduces when hand-rolling bulk ops.BatchSize— configurable, default 100, validated>= 1.TransformWorkerAsyncso the batching contract can't drift; derived classes only implementCreateProgressReport.CurrentItemCountcounts batches yielded (the downstream unit of work), not input items. Cancellation observed while enumerating.Per the issue, this likely moves to a future
Wolfgang.Etl.Transformerspackage; it lives in Abstractions until that exists.Verified
MINOR (additive).
PublicAPI.Shipped.txtregenerated. Full Release build clean across all TFMs (0 warnings); 246 tests pass (7 new: evenly-divisible, remainder-flush, single-partial, empty source, batch counting,BatchSizedefault + validation).Part of: #154