Soenneker.ConcurrentProcessing.Executor 4.0.200

Prefix Reserved
dotnet add package Soenneker.ConcurrentProcessing.Executor --version 4.0.200
                    
NuGet\Install-Package Soenneker.ConcurrentProcessing.Executor -Version 4.0.200
                    
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.200" />
                    
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.200" />
                    
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.200
                    
#r "nuget: Soenneker.ConcurrentProcessing.Executor, 4.0.200"
                    
#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.200
                    
#: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.200
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.ConcurrentProcessing.Executor&version=4.0.200
                    
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

This executor efficiently handles multiple tasks with controlled concurrency. It is ideal for managing parallel execution of tasks while ensuring that no more than a specified number of tasks run simultaneously.

Key Features

  • Concurrent Execution: Limits the number of concurrent tasks to prevent overloading.
  • Failure Handling with Retry Logic: Automatically retries failed tasks with exponential backoff.
  • Async Semaphore: Uses a non-blocking semaphore to control concurrency and ensure thread safety.
  • CancellationToken support for task cancellation.

⚠️ Note:

  • This is not a background processor. It only manages concurrency for tasks that are provided during execution.

Installation

dotnet add package Soenneker.ConcurrentProcessing.Executor

Example: Executing Multiple Tasks with Concurrency Control

using System;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using Soenneker.ConcurrentProcessing.Executor;

public class Program
{
    public static async Task Main(string[] args)
    {
        var executor = new ConcurrentProcessingExecutor(maxConcurrency: 3);

        var tasks = new List<Func<CancellationToken, ValueTask>>
        {
            async (ct) => { 
                Console.WriteLine("Task 1 started"); 
                await Task.Delay(500, ct); 
                Console.WriteLine("Task 1 completed"); 
            },

            async (ct) => { 
                Console.WriteLine("Task 2 started"); 
                await Task.Delay(300, ct); 
                Console.WriteLine("Task 2 completed"); 
            },

            async (ct) => { 
                Console.WriteLine("Task 3 started"); 
                await Task.Delay(700, ct); 
                Console.WriteLine("Task 3 completed");
            },

            async (ct) => { 
                Console.WriteLine("Task 4 started"); 
                await Task.Delay(400, ct); 
                Console.WriteLine("Task 4 completed"); 
            }
        };

        await executor.Execute(tasks);
    }
}

Console Output

Task 1 started
Task 2 started
Task 3 started
Task 1 completed
Task 4 started
Task 2 completed
Task 3 completed
Task 4 completed
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.200 210 11/3/2025
4.0.199 42 11/3/2025
4.0.198 500 10/30/2025
4.0.197 290 10/30/2025
4.0.196 160 10/30/2025
4.0.195 219 10/30/2025
4.0.194 166 10/29/2025
3.0.193 927 10/16/2025
3.0.192 164 10/16/2025
3.0.191 1,951 9/10/2025
3.0.190 476 9/9/2025
3.0.189 165 9/9/2025
3.0.188 286 9/9/2025
3.0.187 882 9/3/2025
3.0.186 167 9/3/2025
3.0.185 420 9/3/2025
3.0.184 170 9/3/2025
3.0.183 175 9/3/2025
3.0.182 176 9/3/2025
3.0.181 180 9/3/2025
3.0.180 718 8/20/2025
3.0.179 1,358 8/11/2025
3.0.178 280 8/11/2025
3.0.177 229 8/11/2025
3.0.176 166 8/11/2025
3.0.175 161 8/11/2025
3.0.174 1,139 8/5/2025
3.0.173 354 8/5/2025
3.0.172 304 8/5/2025
3.0.171 1,398 7/9/2025
3.0.170 260 7/8/2025
3.0.169 321 7/8/2025
3.0.168 1,430 6/28/2025
3.0.167 298 6/27/2025
3.0.166 106 6/27/2025
3.0.165 103 6/27/2025
3.0.164 249 6/27/2025
3.0.163 1,504 6/10/2025
3.0.162 450 6/10/2025
3.0.161 372 6/10/2025
3.0.160 461 6/3/2025
3.0.159 931 5/27/2025
3.0.158 299 5/27/2025
3.0.157 168 5/27/2025
3.0.156 267 5/27/2025
3.0.155 1,314 5/23/2025
3.0.154 287 5/23/2025
3.0.153 195 5/23/2025
3.0.152 256 5/22/2025
3.0.151 895 5/14/2025
3.0.150 338 5/13/2025
3.0.149 1,081 5/8/2025
3.0.148 298 5/8/2025
3.0.147 160 5/8/2025
3.0.146 192 5/7/2025
3.0.145 609 5/5/2025
3.0.144 179 5/5/2025
3.0.143 161 5/5/2025
3.0.142 165 5/5/2025
3.0.141 188 5/5/2025
3.0.140 859 5/5/2025
3.0.139 1,947 4/8/2025
3.0.138 282 4/8/2025
3.0.137 197 4/8/2025
3.0.136 192 4/8/2025
3.0.135 196 4/8/2025
3.0.134 206 4/8/2025
3.0.133 188 4/8/2025
3.0.132 700 4/8/2025
3.0.131 431 4/8/2025
3.0.130 352 4/8/2025
3.0.129 520 4/8/2025
3.0.128 484 4/8/2025
3.0.127 397 4/7/2025
3.0.126 349 4/7/2025
3.0.125 636 4/7/2025
3.0.124 388 4/7/2025
3.0.123 527 4/7/2025
3.0.122 238 4/7/2025
3.0.121 201 4/7/2025
3.0.120 192 4/7/2025
3.0.119 180 4/6/2025
3.0.118 194 4/6/2025
3.0.117 203 4/6/2025
3.0.116 192 4/6/2025
3.0.115 176 4/6/2025
3.0.114 154 4/6/2025
3.0.113 150 4/6/2025
3.0.112 125 4/6/2025
3.0.111 163 4/6/2025
3.0.110 154 4/6/2025
3.0.109 147 4/6/2025
3.0.108 134 4/6/2025
3.0.107 107 4/5/2025
3.0.106 117 4/5/2025
3.0.105 118 4/5/2025
3.0.104 120 4/5/2025
3.0.103 112 4/5/2025
3.0.102 136 4/5/2025
3.0.101 121 4/5/2025
3.0.100 124 4/4/2025
3.0.99 130 4/4/2025
3.0.98 153 4/4/2025
3.0.97 3,044 4/3/2025
3.0.96 667 4/1/2025
3.0.95 385 4/1/2025
3.0.94 254 4/1/2025
3.0.93 606 3/31/2025
3.0.92 246 3/31/2025
3.0.91 490 3/31/2025
3.0.90 306 3/31/2025
3.0.89 341 3/29/2025
3.0.88 123 3/29/2025
3.0.87 216 3/29/2025
3.0.86 938 3/25/2025
3.0.85 621 3/25/2025
3.0.84 312 3/21/2025
3.0.83 331 3/21/2025
3.0.82 478 3/18/2025
3.0.81 367 3/18/2025
3.0.80 388 3/15/2025
3.0.79 175 3/15/2025
3.0.78 357 3/12/2025
3.0.77 196 3/12/2025
3.0.76 207 3/12/2025
3.0.75 217 3/12/2025
3.0.74 204 3/11/2025
3.0.73 239 3/11/2025
3.0.72 258 3/11/2025
3.0.71 628 3/11/2025
3.0.70 384 3/11/2025
3.0.69 311 3/11/2025
3.0.68 205 3/11/2025
3.0.67 333 3/11/2025
3.0.66 485 3/7/2025
3.0.65 337 3/7/2025
3.0.64 566 3/2/2025
3.0.63 376 3/2/2025
3.0.62 165 3/2/2025
3.0.61 256 3/2/2025
3.0.60 231 3/1/2025
3.0.59 290 3/1/2025
3.0.58 140 3/1/2025
3.0.57 219 3/1/2025
3.0.56 381 3/1/2025
3.0.55 154 3/1/2025
3.0.54 125 3/1/2025
3.0.53 135 3/1/2025
3.0.52 127 3/1/2025
3.0.51 272 3/1/2025
3.0.50 128 3/1/2025
3.0.49 478 2/25/2025
3.0.48 221 2/25/2025
3.0.47 228 2/25/2025
3.0.46 256 2/25/2025
3.0.45 154 2/25/2025
3.0.44 331 2/24/2025
3.0.43 242 2/23/2025
3.0.42 157 2/22/2025
3.0.41 429 2/22/2025
3.0.40 393 2/22/2025
3.0.39 302 2/22/2025
3.0.38 168 2/22/2025
3.0.37 257 2/22/2025
3.0.36 273 2/22/2025
3.0.35 157 2/21/2025
3.0.34 409 2/21/2025
3.0.33 247 2/21/2025
3.0.32 458 2/19/2025
3.0.31 611 2/18/2025
3.0.30 262 2/18/2025
3.0.29 361 2/18/2025
3.0.28 160 2/18/2025
3.0.27 488 2/14/2025
3.0.26 368 2/14/2025
3.0.25 259 2/13/2025
3.0.24 295 2/13/2025
3.0.23 450 2/12/2025
3.0.22 140 2/12/2025
3.0.21 277 2/12/2025
3.0.20 231 2/12/2025
3.0.19 359 2/11/2025
3.0.18 165 2/11/2025
3.0.17 442 2/11/2025
3.0.16 146 2/11/2025
3.0.15 247 2/11/2025
3.0.14 242 2/11/2025
3.0.13 163 2/11/2025
3.0.12 159 2/10/2025
3.0.11 131 2/10/2025
3.0.10 220 2/10/2025
3.0.9 270 2/10/2025
3.0.8 146 2/10/2025
3.0.7 140 2/10/2025
3.0.6 165 2/10/2025
3.0.5 137 2/10/2025
3.0.4 230 2/9/2025
3.0.3 380 2/9/2025
3.0.2 389 2/8/2025
3.0.1 380 2/7/2025