Musoftware.BatchProcessor 1.1.0

dotnet add package Musoftware.BatchProcessor --version 1.1.0
                    
NuGet\Install-Package Musoftware.BatchProcessor -Version 1.1.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Musoftware.BatchProcessor" Version="1.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Musoftware.BatchProcessor" Version="1.1.0" />
                    
Directory.Packages.props
<PackageReference Include="Musoftware.BatchProcessor" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Musoftware.BatchProcessor --version 1.1.0
                    
#r "nuget: Musoftware.BatchProcessor, 1.1.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Musoftware.BatchProcessor@1.1.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Musoftware.BatchProcessor&version=1.1.0
                    
Install as a Cake Addin
#tool nuget:?package=Musoftware.BatchProcessor&version=1.1.0
                    
Install as a Cake Tool

Musoftware.BatchProcessor

High-performance, domain-agnostic generic batch processing library for .NET with rate limiting, real-time result streaming, exponential retries, circuit breaker protection, dead letter queue support, sliding-window speed monitoring, and auto-slowdown detection.

Features

  • High Performance & Parallel Execution: Configurable MaxDegreeOfParallelism and BatchSize.
  • 🛑 Rate Limiting & Throughput Cap: Enforce MaxItemsPerSecond to prevent API rate limiting (429 errors).
  • 🌊 Real-Time Result Streaming: Process results as they finish via ProcessStreamingAsync (IAsyncEnumerable<BatchItemResult<TInput, TOutput>>).
  • 🔄 Advanced Retry Strategies: Support for Fixed, Exponential, and ExponentialWithJitter backoffs with exception filtering predicates.
  • Circuit Breaker Protection: Pause execution when consecutive failure thresholds are breached (WithCircuitBreaker).
  • 📬 Dead Letter Queue (DLQ): Automatic capture and export of failed items via IDeadLetterCollector<TInput, TOutput>.
  • 📊 Sliding-Window Speed Monitor: Real-time throughput (items/sec) tracking and progress metrics (BatchProgress).
  • ⚠️ Auto-Slowdown Detection: Trigger events (OnSlowdownDetected) when throughput drops below minimum thresholds.
  • 🎯 Domain Agnostic: Fully generic IBatchProcessor<TInput, TOutput> for any data type or processing delegate.
  • ⚙️ Fluent Configuration: Fluent BatchProcessorOptionsBuilder for clean initialization.

Installation

dotnet add package Musoftware.BatchProcessor

Quick Start

using Musoftware.BatchProcessor;

// 1. Configure options with Fluent Builder
var options = new BatchProcessorOptionsBuilder()
    .WithMaxDegreeOfParallelism(16)
    .WithBatchSize(1000)
    .WithMaxItemsPerSecond(500.0) // Rate limiting
    .WithRetry(
        retryCount: 3,
        retryDelay: TimeSpan.FromMilliseconds(100),
        strategy: RetryBackoffStrategy.ExponentialWithJitter,
        shouldRetry: ex => ex is HttpRequestException || ex is TimeoutException)
    .WithCircuitBreaker(failureThreshold: 10, breakDuration: TimeSpan.FromSeconds(5))
    .WithContinueOnError(true)
    .Build();

var engine = new BatchProcessingEngine<string, int>(options);

// 2. Stream Batch Results in Real Time
var items = Enumerable.Range(1, 10000).Select(i => $"Item_{i}");

await foreach (var result in engine.ProcessStreamingAsync(
    items,
    async (item, cancellationToken) =>
    {
        await Task.Delay(10, cancellationToken);
        return item.Length;
    }))
{
    if (result.IsSuccess)
    {
        Console.WriteLine($"Processed {result.Input} -> {result.Output}");
    }
}

License

MIT

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net8.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.1.0 93 8/9/2026
1.0.1 101 8/9/2026