TaskProcessor 1.1.2

dotnet add package TaskProcessor --version 1.1.2
                    
NuGet\Install-Package TaskProcessor -Version 1.1.2
                    
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="TaskProcessor" Version="1.1.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="TaskProcessor" Version="1.1.2" />
                    
Directory.Packages.props
<PackageReference Include="TaskProcessor" />
                    
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 TaskProcessor --version 1.1.2
                    
#r "nuget: TaskProcessor, 1.1.2"
                    
#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 TaskProcessor@1.1.2
                    
#: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=TaskProcessor&version=1.1.2
                    
Install as a Cake Addin
#tool nuget:?package=TaskProcessor&version=1.1.2
                    
Install as a Cake Tool

TaskProcessor

A lightweight .NET library for controlled concurrent task processing with built-in retry and error handling.


🚀 Overview

TaskProcessor helps you process large collections of tasks efficiently while preventing system overload.

It provides:

  • Controlled parallel execution
  • Retry mechanisms for transient failures
  • Error handling strategies
  • Support for both execution and transformation workloads

🎯 Problem It Solves

In real-world backend systems, processing large datasets (thousands of records, API calls, or jobs) can lead to:

  • CPU spikes
  • Database connection exhaustion
  • API throttling
  • Unstable performance

Naively running all tasks in parallel (Task.WhenAll) can overwhelm the system.

TaskProcessor solves this by limiting concurrency and adding reliability controls.


⚙️ Features

  • ✅ Configurable concurrency (MaxDegreeOfParallelism)
  • ✅ Retry support with delay
  • ✅ Continue or fail on error
  • ✅ Error callbacks for logging/monitoring
  • ✅ Supports async operations
  • ✅ Generic design (works with any task)

📦 Installation

Install via NuGet:

dotnet add package TaskProcessor

🧠 Usage

1. Process tasks (no return)

var processor = new TaskProcessor(new TaskProcessorOptions
{
    MaxDegreeOfParallelism = 3,
    RetryCount = 2
});

await processor.ProcessAsync(data, async item =>
{
    await ProcessItem(item);
});

2. Transform data (with return value)

var results = await processor.ProcessAsync<Source, Destination>(
    sourceData,
    async item =>
    {
        return mapper.Map<Destination>(item);
    });

🔁 How It Works

TaskProcessor internally:

  1. Limits concurrent execution using a semaphore
  2. Executes tasks in parallel within defined limits
  3. Retries failed tasks based on configuration
  4. Collects results (for transformation scenarios)

📊 Use Cases

  • Processing large datasets (data migration, ETL)
  • Calling external APIs with rate limits
  • Background job processing
  • Bulk data transformations
  • File or message processing

⚠️ Notes

  • Result order is not guaranteed in parallel execution
  • Best suited for independent tasks
  • Avoid very high parallelism for CPU-bound workloads

🧩 Design Philosophy

TaskProcessor follows a simple principle:

You define the work — TaskProcessor manages how it runs.

It keeps business logic separate from execution control, making it reusable across different domains.


🔮 Future Improvements

  • Batch processing support
  • Exponential backoff retry strategy
  • Metrics and performance tracking
  • Rate limiting

📄 License

MIT License

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.2 42 3/20/2026
1.1.1 55 3/20/2026 1.1.1 is deprecated because it is no longer maintained.
1.1.0 57 3/19/2026 1.1.0 is deprecated because it is no longer maintained.