Soenneker.ConcurrentProcessing.Executor 4.0.207

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.207
                    
NuGet\Install-Package Soenneker.ConcurrentProcessing.Executor -Version 4.0.207
                    
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.207" />
                    
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.207" />
                    
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.207
                    
#r "nuget: Soenneker.ConcurrentProcessing.Executor, 4.0.207"
                    
#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.207
                    
#: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.207
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.ConcurrentProcessing.Executor&version=4.0.207
                    
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.241 593 1/22/2026
4.0.240 1,113 1/14/2026
4.0.239 186 1/14/2026
4.0.238 93 1/13/2026
4.0.237 575 1/12/2026
4.0.236 86 1/12/2026
4.0.235 306 1/9/2026
4.0.234 381 1/8/2026
4.0.233 90 1/8/2026
4.0.232 164 1/8/2026
4.0.231 411 1/7/2026
4.0.230 427 1/6/2026
4.0.228 194 1/6/2026
4.0.227 88 1/6/2026
4.0.226 289 1/5/2026
4.0.225 536 1/3/2026
4.0.224 87 1/3/2026
4.0.223 270 1/3/2026
4.0.222 99 1/3/2026
4.0.221 89 1/2/2026
4.0.220 225 1/2/2026
4.0.219 89 1/2/2026
4.0.218 363 12/31/2025
4.0.217 199 12/31/2025
4.0.216 647 12/21/2025
4.0.215 123 12/21/2025
4.0.214 676 12/17/2025
4.0.213 422 12/15/2025
4.0.212 253 12/15/2025
4.0.211 532 12/12/2025
4.0.210 669 12/10/2025
4.0.209 438 12/10/2025
4.0.208 1,013 11/21/2025
4.0.207 407 11/21/2025
4.0.206 397 11/20/2025
4.0.205 396 11/20/2025
4.0.204 1,238 11/11/2025
4.0.203 362 11/11/2025
4.0.202 811 11/6/2025
4.0.201 263 11/6/2025
4.0.200 607 11/3/2025
4.0.199 204 11/3/2025
4.0.198 599 10/30/2025
4.0.197 337 10/30/2025
4.0.196 203 10/30/2025
4.0.195 255 10/30/2025
4.0.194 199 10/29/2025
3.0.193 963 10/16/2025
3.0.192 197 10/16/2025
3.0.191 1,991 9/10/2025
3.0.190 507 9/9/2025
3.0.189 193 9/9/2025
3.0.188 313 9/9/2025
3.0.187 928 9/3/2025
3.0.186 193 9/3/2025
3.0.185 449 9/3/2025
3.0.184 194 9/3/2025
3.0.183 205 9/3/2025
3.0.182 200 9/3/2025
3.0.181 207 9/3/2025
3.0.180 743 8/20/2025
3.0.179 1,393 8/11/2025
3.0.178 303 8/11/2025
3.0.177 250 8/11/2025
3.0.176 193 8/11/2025
3.0.175 188 8/11/2025
3.0.174 1,172 8/5/2025
3.0.173 377 8/5/2025
3.0.172 331 8/5/2025
3.0.171 1,443 7/9/2025
3.0.170 278 7/8/2025
3.0.169 345 7/8/2025
3.0.168 1,482 6/28/2025
3.0.167 325 6/27/2025
3.0.166 133 6/27/2025
3.0.165 124 6/27/2025
3.0.164 276 6/27/2025
3.0.163 1,530 6/10/2025
3.0.162 474 6/10/2025
3.0.161 405 6/10/2025
3.0.160 486 6/3/2025
3.0.159 964 5/27/2025
3.0.158 321 5/27/2025
3.0.157 188 5/27/2025
3.0.156 292 5/27/2025
3.0.155 1,352 5/23/2025
3.0.154 307 5/23/2025
3.0.153 217 5/23/2025
3.0.152 278 5/22/2025
3.0.151 924 5/14/2025
3.0.150 359 5/13/2025
3.0.149 1,113 5/8/2025
3.0.148 337 5/8/2025
3.0.147 186 5/8/2025
3.0.146 217 5/7/2025
3.0.145 628 5/5/2025
3.0.144 204 5/5/2025
3.0.143 177 5/5/2025
3.0.142 183 5/5/2025
3.0.141 212 5/5/2025
3.0.140 892 5/5/2025
3.0.139 1,988 4/8/2025
3.0.138 310 4/8/2025
3.0.137 223 4/8/2025
3.0.136 217 4/8/2025
3.0.135 221 4/8/2025
3.0.134 243 4/8/2025
3.0.133 217 4/8/2025
3.0.132 733 4/8/2025
3.0.131 460 4/8/2025
3.0.130 371 4/8/2025
3.0.129 545 4/8/2025
3.0.128 509 4/8/2025
3.0.127 420 4/7/2025
3.0.126 367 4/7/2025
3.0.125 665 4/7/2025
3.0.124 415 4/7/2025
3.0.123 550 4/7/2025
3.0.122 260 4/7/2025
3.0.121 218 4/7/2025
3.0.120 226 4/7/2025
3.0.119 195 4/6/2025
3.0.118 219 4/6/2025
3.0.117 223 4/6/2025
3.0.116 217 4/6/2025
3.0.115 196 4/6/2025
3.0.114 178 4/6/2025
3.0.113 174 4/6/2025
3.0.112 148 4/6/2025
3.0.111 185 4/6/2025
3.0.110 173 4/6/2025
3.0.109 173 4/6/2025
3.0.108 155 4/6/2025
3.0.107 132 4/5/2025
3.0.106 139 4/5/2025
3.0.105 141 4/5/2025
3.0.104 147 4/5/2025
3.0.103 133 4/5/2025
3.0.102 156 4/5/2025
3.0.101 143 4/5/2025
3.0.100 148 4/4/2025
3.0.99 149 4/4/2025
3.0.98 171 4/4/2025
3.0.97 3,101 4/3/2025
3.0.96 706 4/1/2025
3.0.95 408 4/1/2025
3.0.94 285 4/1/2025
3.0.93 632 3/31/2025
3.0.92 270 3/31/2025
3.0.91 510 3/31/2025
3.0.90 324 3/31/2025
3.0.89 363 3/29/2025
3.0.88 149 3/29/2025
3.0.87 251 3/29/2025
3.0.86 962 3/25/2025
3.0.85 648 3/25/2025
3.0.84 350 3/21/2025
3.0.83 363 3/21/2025
3.0.82 512 3/18/2025
3.0.81 390 3/18/2025
3.0.80 429 3/15/2025
3.0.79 209 3/15/2025
3.0.78 398 3/12/2025
3.0.77 220 3/12/2025
3.0.76 232 3/12/2025
3.0.75 241 3/12/2025
3.0.74 226 3/11/2025
3.0.73 262 3/11/2025
3.0.72 697 3/11/2025
3.0.71 654 3/11/2025
3.0.70 414 3/11/2025
3.0.69 338 3/11/2025
3.0.68 221 3/11/2025
3.0.67 356 3/11/2025
3.0.66 509 3/7/2025
3.0.65 354 3/7/2025
3.0.64 590 3/2/2025
3.0.63 410 3/2/2025
3.0.62 184 3/2/2025
3.0.61 279 3/2/2025
3.0.60 247 3/1/2025
3.0.59 316 3/1/2025
3.0.58 152 3/1/2025
3.0.57 248 3/1/2025
3.0.56 406 3/1/2025
3.0.55 176 3/1/2025
3.0.54 145 3/1/2025
3.0.53 159 3/1/2025
3.0.52 147 3/1/2025
3.0.51 291 3/1/2025
3.0.50 152 3/1/2025
3.0.49 505 2/25/2025
3.0.48 252 2/25/2025
3.0.47 251 2/25/2025
3.0.46 284 2/25/2025
3.0.45 177 2/25/2025
3.0.44 360 2/24/2025
3.0.43 269 2/23/2025
3.0.42 185 2/22/2025
3.0.41 462 2/22/2025
3.0.40 424 2/22/2025
3.0.39 331 2/22/2025
3.0.38 195 2/22/2025
3.0.37 294 2/22/2025
3.0.36 307 2/22/2025
3.0.35 175 2/21/2025
3.0.34 441 2/21/2025
3.0.33 277 2/21/2025
3.0.32 488 2/19/2025
3.0.31 637 2/18/2025
3.0.30 294 2/18/2025
3.0.29 394 2/18/2025
3.0.28 186 2/18/2025
3.0.27 512 2/14/2025
3.0.26 403 2/14/2025
3.0.25 295 2/13/2025
3.0.24 325 2/13/2025
3.0.23 485 2/12/2025
3.0.22 166 2/12/2025
3.0.21 302 2/12/2025
3.0.20 264 2/12/2025
3.0.19 385 2/11/2025
3.0.18 188 2/11/2025
3.0.17 466 2/11/2025
3.0.16 166 2/11/2025
3.0.15 276 2/11/2025
3.0.14 260 2/11/2025
3.0.13 180 2/11/2025
3.0.12 183 2/10/2025
3.0.11 152 2/10/2025
3.0.10 239 2/10/2025
3.0.9 302 2/10/2025
3.0.8 171 2/10/2025
3.0.7 161 2/10/2025
3.0.6 191 2/10/2025
3.0.5 160 2/10/2025
3.0.4 255 2/9/2025
3.0.3 403 2/9/2025
3.0.2 420 2/8/2025
3.0.1 420 2/7/2025