Soenneker.ConcurrentProcessing.Executor 4.0.327

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

alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image

Soenneker.ConcurrentProcessing.Executor

Runs a finite collection of asynchronous work with a fixed concurrency limit and optional per-item retries.

Install

dotnet add package Soenneker.ConcurrentProcessing.Executor

Execute state-based work

Construct an executor with a positive concurrency limit. The state-based overload avoids creating a closure for every item:

using Soenneker.ConcurrentProcessing.Executor;

var executor = new ConcurrentProcessingExecutor(maxConcurrency: 8);

await executor.Execute(
    customerIds,
    static async (customerId, cancellationToken) =>
    {
        await SynchronizeCustomer(customerId, cancellationToken);
    },
    cancellationToken);

Each item is claimed once. Work-item failures are logged when an ILogger is supplied, other items continue, and the completed batch throws an AggregateException containing the failures.

Execute task factories

Use the delegate-list overload when the work is already represented by task factories:

var work = urls
    .Select(url => (Func<Task>)(() => Download(url, cancellationToken)))
    .ToList();

await executor.Execute(work, cancellationToken);

The factories do not receive the executor's cancellation token. Cancellation prevents new factories from starting; running factories stop only if they observe cancellation through their own captured state.

Retry failed work

var work = customerIds
    .Select(id => (Func<CancellationToken, ValueTask>)(ct => SynchronizeCustomer(id, ct)))
    .ToList();

await executor.ExecuteWithRetry(
    work,
    maxRetries: 4,
    initialDelayMs: 250,
    cancellationToken);

maxRetries is the total attempt count, including the first call. Delays use exponential backoff with full jitter and are capped at 30 seconds. An item that exhausts its attempts does not prevent later items from running. Exhausted failures are collected and thrown as an AggregateException after the batch; cancellation is never retried.

Operational notes

  • This is an in-process batch executor, not a durable queue or background service.
  • Do not mutate the supplied list until execution completes.
  • A single executor can be reused across batches; the concurrency limit applies independently to each simultaneous Execute call, not globally across the instance.
  • Retries require idempotent work or an operation-specific strategy for handling partial success.
  • The logger is optional and does not replace exception handling by the caller.
Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  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.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on Soenneker.ConcurrentProcessing.Executor:

Package Downloads
Soenneker.Cosmos.Repository

A data persistence abstraction layer for Cosmos DB

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
4.0.327 381 9/4/2026
4.0.324 1,213 8/29/2026
4.0.323 148 8/29/2026
4.0.322 82 8/29/2026
4.0.321 659 8/26/2026
4.0.320 227 8/25/2026
4.0.319 1,615 8/12/2026
4.0.318 93 8/12/2026
4.0.317 1,752 7/28/2026
4.0.316 203 7/28/2026
4.0.315 180 7/28/2026
4.0.314 156 7/28/2026
4.0.312 137 7/27/2026
4.0.311 1,118 7/18/2026
4.0.310 413 7/17/2026
4.0.309 366 7/16/2026
4.0.308 108 7/16/2026
4.0.307 236 7/16/2026
4.0.306 100 7/16/2026
4.0.305 470 7/15/2026
Loading failed

Aggregate concurrent processing failures