Soenneker.ConcurrentProcessing.Executor 4.0.210

Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package Soenneker.ConcurrentProcessing.Executor --version 4.0.210
                    
NuGet\Install-Package Soenneker.ConcurrentProcessing.Executor -Version 4.0.210
                    
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.210" />
                    
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.210" />
                    
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.210
                    
#r "nuget: Soenneker.ConcurrentProcessing.Executor, 4.0.210"
                    
#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.210
                    
#: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.210
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.ConcurrentProcessing.Executor&version=4.0.210
                    
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.216 467 12/21/2025
4.0.215 114 12/21/2025
4.0.214 669 12/17/2025
4.0.213 415 12/15/2025
4.0.212 246 12/15/2025
4.0.211 522 12/12/2025
4.0.210 656 12/10/2025
4.0.209 426 12/10/2025
4.0.208 1,000 11/21/2025
4.0.207 394 11/21/2025
4.0.206 384 11/20/2025
4.0.205 386 11/20/2025
4.0.204 1,227 11/11/2025
4.0.203 345 11/11/2025
4.0.202 798 11/6/2025
4.0.201 255 11/6/2025
4.0.200 593 11/3/2025
4.0.199 185 11/3/2025
4.0.198 589 10/30/2025
4.0.197 324 10/30/2025
4.0.196 187 10/30/2025
4.0.195 239 10/30/2025
4.0.194 186 10/29/2025
3.0.193 943 10/16/2025
3.0.192 180 10/16/2025
3.0.191 1,974 9/10/2025
3.0.190 489 9/9/2025
3.0.189 178 9/9/2025
3.0.188 301 9/9/2025
3.0.187 909 9/3/2025
3.0.186 178 9/3/2025
3.0.185 432 9/3/2025
3.0.184 179 9/3/2025
3.0.183 190 9/3/2025
3.0.182 193 9/3/2025
3.0.181 194 9/3/2025
3.0.180 732 8/20/2025
3.0.179 1,382 8/11/2025
3.0.178 294 8/11/2025
3.0.177 241 8/11/2025
3.0.176 182 8/11/2025
3.0.175 177 8/11/2025
3.0.174 1,159 8/5/2025
3.0.173 368 8/5/2025
3.0.172 317 8/5/2025
3.0.171 1,430 7/9/2025
3.0.170 270 7/8/2025
3.0.169 333 7/8/2025
3.0.168 1,462 6/28/2025
3.0.167 312 6/27/2025
3.0.166 118 6/27/2025
3.0.165 117 6/27/2025
3.0.164 266 6/27/2025
3.0.163 1,521 6/10/2025
3.0.162 462 6/10/2025
3.0.161 393 6/10/2025
3.0.160 474 6/3/2025
3.0.159 951 5/27/2025
3.0.158 308 5/27/2025
3.0.157 180 5/27/2025
3.0.156 282 5/27/2025
3.0.155 1,338 5/23/2025
3.0.154 298 5/23/2025
3.0.153 210 5/23/2025
3.0.152 270 5/22/2025
3.0.151 909 5/14/2025
3.0.150 349 5/13/2025
3.0.149 1,098 5/8/2025
3.0.148 319 5/8/2025
3.0.147 172 5/8/2025
3.0.146 208 5/7/2025
3.0.145 622 5/5/2025
3.0.144 194 5/5/2025
3.0.143 169 5/5/2025
3.0.142 177 5/5/2025
3.0.141 202 5/5/2025
3.0.140 878 5/5/2025
3.0.139 1,977 4/8/2025
3.0.138 294 4/8/2025
3.0.137 210 4/8/2025
3.0.136 205 4/8/2025
3.0.135 206 4/8/2025
3.0.134 223 4/8/2025
3.0.133 203 4/8/2025
3.0.132 719 4/8/2025
3.0.131 444 4/8/2025
3.0.130 361 4/8/2025
3.0.129 536 4/8/2025
3.0.128 498 4/8/2025
3.0.127 410 4/7/2025
3.0.126 359 4/7/2025
3.0.125 649 4/7/2025
3.0.124 401 4/7/2025
3.0.123 540 4/7/2025
3.0.122 249 4/7/2025
3.0.121 211 4/7/2025
3.0.120 213 4/7/2025
3.0.119 187 4/6/2025
3.0.118 208 4/6/2025
3.0.117 211 4/6/2025
3.0.116 205 4/6/2025
3.0.115 188 4/6/2025
3.0.114 170 4/6/2025
3.0.113 162 4/6/2025
3.0.112 137 4/6/2025
3.0.111 174 4/6/2025
3.0.110 166 4/6/2025
3.0.109 167 4/6/2025
3.0.108 146 4/6/2025
3.0.107 122 4/5/2025
3.0.106 126 4/5/2025
3.0.105 127 4/5/2025
3.0.104 130 4/5/2025
3.0.103 123 4/5/2025
3.0.102 145 4/5/2025
3.0.101 135 4/5/2025
3.0.100 134 4/4/2025
3.0.99 140 4/4/2025
3.0.98 165 4/4/2025
3.0.97 3,088 4/3/2025
3.0.96 693 4/1/2025
3.0.95 398 4/1/2025
3.0.94 271 4/1/2025
3.0.93 623 3/31/2025
3.0.92 256 3/31/2025
3.0.91 499 3/31/2025
3.0.90 314 3/31/2025
3.0.89 354 3/29/2025
3.0.88 133 3/29/2025
3.0.87 232 3/29/2025
3.0.86 953 3/25/2025
3.0.85 632 3/25/2025
3.0.84 338 3/21/2025
3.0.83 347 3/21/2025
3.0.82 493 3/18/2025
3.0.81 379 3/18/2025
3.0.80 408 3/15/2025
3.0.79 196 3/15/2025
3.0.78 376 3/12/2025
3.0.77 212 3/12/2025
3.0.76 221 3/12/2025
3.0.75 229 3/12/2025
3.0.74 215 3/11/2025
3.0.73 251 3/11/2025
3.0.72 625 3/11/2025
3.0.71 640 3/11/2025
3.0.70 406 3/11/2025
3.0.69 327 3/11/2025
3.0.68 215 3/11/2025
3.0.67 345 3/11/2025
3.0.66 500 3/7/2025
3.0.65 345 3/7/2025
3.0.64 578 3/2/2025
3.0.63 395 3/2/2025
3.0.62 176 3/2/2025
3.0.61 269 3/2/2025
3.0.60 239 3/1/2025
3.0.59 302 3/1/2025
3.0.58 146 3/1/2025
3.0.57 236 3/1/2025
3.0.56 397 3/1/2025
3.0.55 164 3/1/2025
3.0.54 135 3/1/2025
3.0.53 146 3/1/2025
3.0.52 137 3/1/2025
3.0.51 282 3/1/2025
3.0.50 141 3/1/2025
3.0.49 491 2/25/2025
3.0.48 236 2/25/2025
3.0.47 236 2/25/2025
3.0.46 275 2/25/2025
3.0.45 166 2/25/2025
3.0.44 349 2/24/2025
3.0.43 258 2/23/2025
3.0.42 171 2/22/2025
3.0.41 450 2/22/2025
3.0.40 412 2/22/2025
3.0.39 320 2/22/2025
3.0.38 182 2/22/2025
3.0.37 282 2/22/2025
3.0.36 288 2/22/2025
3.0.35 164 2/21/2025
3.0.34 430 2/21/2025
3.0.33 262 2/21/2025
3.0.32 480 2/19/2025
3.0.31 629 2/18/2025
3.0.30 282 2/18/2025
3.0.29 379 2/18/2025
3.0.28 177 2/18/2025
3.0.27 500 2/14/2025
3.0.26 389 2/14/2025
3.0.25 281 2/13/2025
3.0.24 307 2/13/2025
3.0.23 463 2/12/2025
3.0.22 153 2/12/2025
3.0.21 288 2/12/2025
3.0.20 250 2/12/2025
3.0.19 375 2/11/2025
3.0.18 177 2/11/2025
3.0.17 452 2/11/2025
3.0.16 156 2/11/2025
3.0.15 263 2/11/2025
3.0.14 250 2/11/2025
3.0.13 172 2/11/2025
3.0.12 170 2/10/2025
3.0.11 140 2/10/2025
3.0.10 229 2/10/2025
3.0.9 281 2/10/2025
3.0.8 155 2/10/2025
3.0.7 152 2/10/2025
3.0.6 180 2/10/2025
3.0.5 147 2/10/2025
3.0.4 239 2/9/2025
3.0.3 394 2/9/2025
3.0.2 405 2/8/2025
3.0.1 403 2/7/2025