Changelog
All notable changes to DataflowBuilder will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
Unreleased
1.1.1 - 2026-10-17
Added
- TimeBatchBlock (Temporal Window Batching):
- Added
TimeBatchBlock<T>supporting time-based flushing or maximum item count batching (Batch(batchSize, timeout)). - Built-in timer flush mechanism that automatically dispatches buffered items when the configured duration expires, regardless of whether the count threshold is met.
- Automatic completion and fault propagation to ensure buffered items are cleanly flushed upon pipeline completion.
- Added
- Pipeline Ingestion & Streaming Extensions:
SendAllAsync: Asynchronous bulk streaming forIEnumerable<T>andIAsyncEnumerable<T>collections with cancellation token support.SendFromChannelAsync: Seamless bridge fromSystem.Threading.Channels.ChannelReader<T>with automatic pipeline completion upon channel exhaustion.ToChannel: Direct extraction of pipeline output buffers as an asynchronousChannelReader<T>.
- Fault Tolerance & Resilience:
ProcessAsyncoverload with retry resilience (retryCount,retryDelay), providing automatic retries with backoff for transient failures before propagating exceptions.
- Multi-Source Pipelines:
DataFlowPipelineBuilder.FromSources<T1, T2>()builder to ingest and coordinate two independent input streams into a single pipeline.IPipeline<TSource1, TSource2>abstraction providing asynchronousSend1AsyncandSend2Asyncingestion methods with unified completion.- Multi-source example project (
examples/MultiBookReaderExample).
- Grouping & Projection Blocks:
- Keyed batch grouping block
GroupBlock<TGroupKey, TInput>for aggregating stream elements by key with range-based windowing. - One-to-many projection blocks (
ProcessMany,ProcessManyAsync). - Configurable source block default buffer sizes and block parallelism (
maxDegreeOfParallelism).
- Keyed batch grouping block
- Documentation & Architecture:
- Complete XML API documentation comments for all public interfaces, classes, methods, and extensions across
DotnetKit.DataflowBuilder. - DocFX-powered static documentation site and interactive API reference.
- GitHub Actions workflow (
docs.yml) for automated documentation builds and GitHub Pages deployment. - Architecture guide (
ARCHITECTURE.md) covering memory model, block mapping, and fault isolation. - Guides for Getting Started, Pipeline Concepts, Multi-Source Pipelines, Parallelism & Performance, Error Handling, and Custom Blocks.
- Use case reference table in root
README.mdmapping use cases to solutions and real-world examples. - Mermaid workflow diagrams and structured input/output sample tables in
BookReaderExampleandMultiBookReaderExample. - Project Roadmap (
ROADMAP.md).
- Complete XML API documentation comments for all public interfaces, classes, methods, and extensions across
- Test Suite & Code Quality:
- Dedicated unit test suite
PipelineExtensions.Tests.csbringingPipelineExtensionsto 100% line and branch test coverage. - Multi-source concurrent test suite
DateflowBuilder.MultiSource.Tests.cs. - Modern C# & ReSharper development guidelines skill (
.agents/skills/resharper-csharp) and automated formatting script. - Recommended modern
.editorconfigruleset.
- Dedicated unit test suite
Changed
- Promoted
PipelineExtensionsandPipelineBuilderExtensionsto the rootDotnetKit.DataflowBuildernamespace, enabling immediate fluent API discovery without additionalusingstatements. - Targeted latest LTS runtime (
net8.0) across all libraries, examples, and test projects while preservingnetstandard2.1compatibility. - Enhanced word splitting behavior and token handling in
BookReaderExample. - Modernized GitHub Actions CI/CD workflows: upgraded public deployment to NuGet Trusted Publishing via GitHub Actions OIDC (
NuGet/login@v1), migrated internal package deployment to standardGITHUB_TOKENpermissions, and standardized MinVer pre-release configuration.
Performance
- Zero-Allocation Pipeline Ingestion: Replaced
async/awaitstate machine wrappers inSendAsync,Send1Async, andSend2Asyncwith direct task returns, eliminating heap state machine allocations on every message sent into the pipeline. - Single-Stage Pipeline Completion: Avoided allocating
Task.WhenAllpromise objects inCompleteAsync()when the source and destination blocks are the same block. - Synchronization Context Decoupling: Added
.ConfigureAwait(false)to asynchronous delegate wrappers inDataFlowPipelineBuilderandGroupBlockto prevent context switches and avoid deadlock vulnerabilities in UI and single-threaded runtimes. - Pre-sized Collections: Pre-sized remaining batch collections in
GroupBlockflush routines to prevent array resizing overhead. - Socket and Resource Optimization: Reused
static readonly HttpClientwith decompression in sample services to prevent socket exhaustion. - Early-Exit Partitioning: Added empty collection short-circuit in
EnumerableExtensions.GroupByRange.
Fixed
- Multi-Targeting SDK Publishing Issue: Added
<IsPublishable>false</IsPublishable>to class library and unit test projects, resolvingNETSDK1129errors duringdotnet publish. - Packaging Warnings: Added
<IsPackable>false</IsPackable>to example projects to prevent unintentional packaging andNU5104warnings. - GroupBlock Data Loss on Completion: Fixed silent data loss in
GroupBlock<TGroupKey, TInput>by automatically flushing buffered partial groups and propagating completion/fault downstream upon input completion. - GroupBlock Race Condition: Synchronized internal dictionary and list state mutations in
GroupBlock<TGroupKey, TInput>to guarantee thread safety under concurrent parallelism (maxDegreeOfParallelism > 1). - Group Extension Parameter Inversion: Decoupled
boundedCapacityandmaxDegreeOfParallelisminPipelineBuilderExtensions.Groupto allow configuring group batch sizes independently from concurrency. - BasePropagatorBlock Encapsulation Allocation: Cached the encapsulated
DataflowBlock.Encapsulateinstance inBasePropagatorBlock<TInput, TOutput>to eliminate repeated object allocations per dataflow connector call, and corrected fault propagation on completion. - API Method Typo: Added
CreateAsyncActionBlockwith corrected spelling inIPipelineBuilderandDataFlowPipelineBuilder, preservingCreateAscynActionBlockas an[Obsolete]forwarding member for backward compatibility. - Inactive Test Suite Activation: Restored missing
[TestMethod]attribute onShould_Build_Pipeline_With_Source_And_Target()inDataflowBuilder.Tests.cs. - Generic Type Constraint: Enforced
where TGroupKey : notnullonGroupBlock<TGroupKey, TInput>andPipelineBuilderExtensions.Groupto resolve compiler warningCS8714.
1.1.0 - 2024-12-05
Added
- Initial public release of
DotnetKit.DataflowBuilder. - Fluent pipeline builder for single sources (
DataFlowPipelineBuilder.FromSource<T>()). - Synchronous and asynchronous block processing stages (
Process,ProcessAsync). - Batching block support (
Batch). - Terminal action targets (
ToTarget,ToTargetAsync). - Bounded buffer capacities with backpressure support.
- Automatic completion propagation and fault trapping across pipeline blocks.
- Sample project
BookReaderExampledemonstrating pipeline execution.
Changed
- Removed legacy .NET 5 target in favor of modern .NET.
- Updated package metadata, MIT licensing, and project repository URLs.