Soenneker.ConcurrentProcessing.Executor 3.0.98

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 3.0.98
                    
NuGet\Install-Package Soenneker.ConcurrentProcessing.Executor -Version 3.0.98
                    
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="3.0.98" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soenneker.ConcurrentProcessing.Executor" Version="3.0.98" />
                    
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 3.0.98
                    
#r "nuget: Soenneker.ConcurrentProcessing.Executor, 3.0.98"
                    
#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@3.0.98
                    
#: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=3.0.98
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.ConcurrentProcessing.Executor&version=3.0.98
                    
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 net9.0 is compatible.  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.

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.231 0 1/7/2026
4.0.230 108 1/6/2026
4.0.228 75 1/6/2026
4.0.227 35 1/6/2026
4.0.226 176 1/5/2026
4.0.225 404 1/3/2026
4.0.224 39 1/3/2026
4.0.223 210 1/3/2026
4.0.222 45 1/3/2026
4.0.221 44 1/2/2026
4.0.220 162 1/2/2026
4.0.219 43 1/2/2026
4.0.218 338 12/31/2025
4.0.217 190 12/31/2025
4.0.216 615 12/21/2025
4.0.215 116 12/21/2025
4.0.214 671 12/17/2025
4.0.213 416 12/15/2025
4.0.212 247 12/15/2025
4.0.211 526 12/12/2025
4.0.210 657 12/10/2025
4.0.209 429 12/10/2025
4.0.208 1,004 11/21/2025
4.0.207 399 11/21/2025
4.0.206 386 11/20/2025
4.0.205 390 11/20/2025
4.0.204 1,231 11/11/2025
4.0.203 348 11/11/2025
4.0.202 802 11/6/2025
4.0.201 257 11/6/2025
4.0.200 597 11/3/2025
4.0.199 191 11/3/2025
4.0.198 591 10/30/2025
4.0.197 327 10/30/2025
4.0.196 195 10/30/2025
4.0.195 244 10/30/2025
4.0.194 189 10/29/2025
3.0.193 946 10/16/2025
3.0.192 185 10/16/2025
3.0.191 1,974 9/10/2025
3.0.190 494 9/9/2025
3.0.189 179 9/9/2025
3.0.188 304 9/9/2025
3.0.187 914 9/3/2025
3.0.186 183 9/3/2025
3.0.185 437 9/3/2025
3.0.184 182 9/3/2025
3.0.183 195 9/3/2025
3.0.182 195 9/3/2025
3.0.181 195 9/3/2025
3.0.180 736 8/20/2025
3.0.179 1,387 8/11/2025
3.0.178 295 8/11/2025
3.0.177 243 8/11/2025
3.0.176 185 8/11/2025
3.0.175 181 8/11/2025
3.0.174 1,161 8/5/2025
3.0.173 371 8/5/2025
3.0.172 320 8/5/2025
3.0.171 1,433 7/9/2025
3.0.170 271 7/8/2025
3.0.169 337 7/8/2025
3.0.168 1,469 6/28/2025
3.0.167 315 6/27/2025
3.0.166 121 6/27/2025
3.0.165 117 6/27/2025
3.0.164 267 6/27/2025
3.0.163 1,524 6/10/2025
3.0.162 465 6/10/2025
3.0.161 395 6/10/2025
3.0.160 477 6/3/2025
3.0.159 953 5/27/2025
3.0.158 312 5/27/2025
3.0.157 182 5/27/2025
3.0.156 286 5/27/2025
3.0.155 1,341 5/23/2025
3.0.154 300 5/23/2025
3.0.153 210 5/23/2025
3.0.152 273 5/22/2025
3.0.151 913 5/14/2025
3.0.150 351 5/13/2025
3.0.149 1,102 5/8/2025
3.0.148 321 5/8/2025
3.0.147 176 5/8/2025
3.0.146 210 5/7/2025
3.0.145 624 5/5/2025
3.0.144 197 5/5/2025
3.0.143 171 5/5/2025
3.0.142 179 5/5/2025
3.0.141 203 5/5/2025
3.0.140 881 5/5/2025
3.0.139 1,981 4/8/2025
3.0.138 297 4/8/2025
3.0.137 214 4/8/2025
3.0.136 211 4/8/2025
3.0.135 211 4/8/2025
3.0.134 229 4/8/2025
3.0.133 205 4/8/2025
3.0.132 721 4/8/2025
3.0.131 447 4/8/2025
3.0.130 363 4/8/2025
3.0.129 538 4/8/2025
3.0.128 500 4/8/2025
3.0.127 411 4/7/2025
3.0.126 361 4/7/2025
3.0.125 652 4/7/2025
3.0.124 404 4/7/2025
3.0.123 541 4/7/2025
3.0.122 250 4/7/2025
3.0.121 213 4/7/2025
3.0.120 217 4/7/2025
3.0.119 188 4/6/2025
3.0.118 210 4/6/2025
3.0.117 214 4/6/2025
3.0.116 210 4/6/2025
3.0.115 190 4/6/2025
3.0.114 171 4/6/2025
3.0.113 164 4/6/2025
3.0.112 139 4/6/2025
3.0.111 179 4/6/2025
3.0.110 169 4/6/2025
3.0.109 167 4/6/2025
3.0.108 148 4/6/2025
3.0.107 123 4/5/2025
3.0.106 129 4/5/2025
3.0.105 132 4/5/2025
3.0.104 141 4/5/2025
3.0.103 126 4/5/2025
3.0.102 146 4/5/2025
3.0.101 137 4/5/2025
3.0.100 139 4/4/2025
3.0.99 142 4/4/2025
3.0.98 167 4/4/2025
3.0.97 3,088 4/3/2025
3.0.96 695 4/1/2025
3.0.95 400 4/1/2025
3.0.94 276 4/1/2025
3.0.93 626 3/31/2025
3.0.92 258 3/31/2025
3.0.91 502 3/31/2025
3.0.90 317 3/31/2025
3.0.89 354 3/29/2025
3.0.88 136 3/29/2025
3.0.87 238 3/29/2025
3.0.86 957 3/25/2025
3.0.85 633 3/25/2025
3.0.84 341 3/21/2025
3.0.83 351 3/21/2025
3.0.82 496 3/18/2025
3.0.81 384 3/18/2025
3.0.80 419 3/15/2025
3.0.79 199 3/15/2025
3.0.78 382 3/12/2025
3.0.77 215 3/12/2025
3.0.76 225 3/12/2025
3.0.75 230 3/12/2025
3.0.74 221 3/11/2025
3.0.73 252 3/11/2025
3.0.72 656 3/11/2025
3.0.71 646 3/11/2025
3.0.70 408 3/11/2025
3.0.69 329 3/11/2025
3.0.68 215 3/11/2025
3.0.67 347 3/11/2025
3.0.66 503 3/7/2025
3.0.65 346 3/7/2025
3.0.64 583 3/2/2025
3.0.63 399 3/2/2025
3.0.62 178 3/2/2025
3.0.61 270 3/2/2025
3.0.60 240 3/1/2025
3.0.59 304 3/1/2025
3.0.58 148 3/1/2025
3.0.57 238 3/1/2025
3.0.56 399 3/1/2025
3.0.55 168 3/1/2025
3.0.54 135 3/1/2025
3.0.53 146 3/1/2025
3.0.52 139 3/1/2025
3.0.51 285 3/1/2025
3.0.50 144 3/1/2025
3.0.49 493 2/25/2025
3.0.48 237 2/25/2025
3.0.47 240 2/25/2025
3.0.46 278 2/25/2025
3.0.45 170 2/25/2025
3.0.44 352 2/24/2025
3.0.43 260 2/23/2025
3.0.42 175 2/22/2025
3.0.41 453 2/22/2025
3.0.40 417 2/22/2025
3.0.39 324 2/22/2025
3.0.38 184 2/22/2025
3.0.37 285 2/22/2025
3.0.36 295 2/22/2025
3.0.35 166 2/21/2025
3.0.34 434 2/21/2025
3.0.33 266 2/21/2025
3.0.32 481 2/19/2025
3.0.31 629 2/18/2025
3.0.30 286 2/18/2025
3.0.29 383 2/18/2025
3.0.28 178 2/18/2025
3.0.27 507 2/14/2025
3.0.26 393 2/14/2025
3.0.25 284 2/13/2025
3.0.24 309 2/13/2025
3.0.23 470 2/12/2025
3.0.22 156 2/12/2025
3.0.21 294 2/12/2025
3.0.20 251 2/12/2025
3.0.19 376 2/11/2025
3.0.18 180 2/11/2025
3.0.17 454 2/11/2025
3.0.16 158 2/11/2025
3.0.15 268 2/11/2025
3.0.14 252 2/11/2025
3.0.13 174 2/11/2025
3.0.12 175 2/10/2025
3.0.11 140 2/10/2025
3.0.10 231 2/10/2025
3.0.9 286 2/10/2025
3.0.8 157 2/10/2025
3.0.7 155 2/10/2025
3.0.6 183 2/10/2025
3.0.5 151 2/10/2025
3.0.4 242 2/9/2025
3.0.3 397 2/9/2025
3.0.2 407 2/8/2025
3.0.1 406 2/7/2025