Soenneker.ConcurrentProcessing.Executor 3.0.189

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.189
                    
NuGet\Install-Package Soenneker.ConcurrentProcessing.Executor -Version 3.0.189
                    
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.189" />
                    
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.189" />
                    
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.189
                    
#r "nuget: Soenneker.ConcurrentProcessing.Executor, 3.0.189"
                    
#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.189
                    
#: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.189
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.ConcurrentProcessing.Executor&version=3.0.189
                    
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
3.0.193 82 10/16/2025
3.0.192 63 10/16/2025
3.0.191 1,680 9/10/2025
3.0.190 444 9/9/2025
3.0.189 161 9/9/2025
3.0.188 279 9/9/2025
3.0.187 822 9/3/2025
3.0.186 165 9/3/2025
3.0.185 405 9/3/2025
3.0.184 168 9/3/2025
3.0.183 172 9/3/2025
3.0.182 175 9/3/2025
3.0.181 174 9/3/2025
3.0.180 669 8/20/2025
3.0.179 1,282 8/11/2025
3.0.178 267 8/11/2025
3.0.177 228 8/11/2025
3.0.176 158 8/11/2025
3.0.175 158 8/11/2025
3.0.174 1,083 8/5/2025
3.0.173 345 8/5/2025
3.0.172 299 8/5/2025
3.0.171 1,365 7/9/2025
3.0.170 252 7/8/2025
3.0.169 317 7/8/2025
3.0.168 1,424 6/28/2025
3.0.167 293 6/27/2025
3.0.166 105 6/27/2025
3.0.165 100 6/27/2025
3.0.164 247 6/27/2025
3.0.163 1,495 6/10/2025
3.0.162 443 6/10/2025
3.0.161 367 6/10/2025
3.0.160 456 6/3/2025
3.0.159 924 5/27/2025
3.0.158 295 5/27/2025
3.0.157 166 5/27/2025
3.0.156 266 5/27/2025
3.0.155 1,311 5/23/2025
3.0.154 284 5/23/2025
3.0.153 185 5/23/2025
3.0.152 252 5/22/2025
3.0.151 890 5/14/2025
3.0.150 336 5/13/2025
3.0.149 1,073 5/8/2025
3.0.148 288 5/8/2025
3.0.147 157 5/8/2025
3.0.146 182 5/7/2025
3.0.145 603 5/5/2025
3.0.144 172 5/5/2025
3.0.143 160 5/5/2025
3.0.142 162 5/5/2025
3.0.141 180 5/5/2025
3.0.140 850 5/5/2025
3.0.139 1,941 4/8/2025
3.0.138 273 4/8/2025
3.0.137 194 4/8/2025
3.0.136 188 4/8/2025
3.0.135 191 4/8/2025
3.0.134 199 4/8/2025
3.0.133 186 4/8/2025
3.0.132 694 4/8/2025
3.0.131 420 4/8/2025
3.0.130 347 4/8/2025
3.0.129 518 4/8/2025
3.0.128 481 4/8/2025
3.0.127 389 4/7/2025
3.0.126 342 4/7/2025
3.0.125 633 4/7/2025
3.0.124 380 4/7/2025
3.0.123 524 4/7/2025
3.0.122 237 4/7/2025
3.0.121 191 4/7/2025
3.0.120 188 4/7/2025
3.0.119 176 4/6/2025
3.0.118 188 4/6/2025
3.0.117 202 4/6/2025
3.0.116 182 4/6/2025
3.0.115 172 4/6/2025
3.0.114 147 4/6/2025
3.0.113 142 4/6/2025
3.0.112 122 4/6/2025
3.0.111 157 4/6/2025
3.0.110 146 4/6/2025
3.0.109 144 4/6/2025
3.0.108 132 4/6/2025
3.0.107 104 4/5/2025
3.0.106 114 4/5/2025
3.0.105 116 4/5/2025
3.0.104 118 4/5/2025
3.0.103 110 4/5/2025
3.0.102 129 4/5/2025
3.0.101 119 4/5/2025
3.0.100 121 4/4/2025
3.0.99 123 4/4/2025
3.0.98 143 4/4/2025
3.0.97 3,029 4/3/2025
3.0.96 665 4/1/2025
3.0.95 384 4/1/2025
3.0.94 253 4/1/2025
3.0.93 604 3/31/2025
3.0.92 244 3/31/2025
3.0.91 487 3/31/2025
3.0.90 303 3/31/2025
3.0.89 339 3/29/2025
3.0.88 121 3/29/2025
3.0.87 212 3/29/2025
3.0.86 934 3/25/2025
3.0.85 610 3/25/2025
3.0.84 305 3/21/2025
3.0.83 327 3/21/2025
3.0.82 474 3/18/2025
3.0.81 364 3/18/2025
3.0.80 384 3/15/2025
3.0.79 174 3/15/2025
3.0.78 355 3/12/2025
3.0.77 195 3/12/2025
3.0.76 203 3/12/2025
3.0.75 210 3/12/2025
3.0.74 200 3/11/2025
3.0.73 229 3/11/2025
3.0.72 238 3/11/2025
3.0.71 619 3/11/2025
3.0.70 373 3/11/2025
3.0.69 307 3/11/2025
3.0.68 198 3/11/2025
3.0.67 322 3/11/2025
3.0.66 479 3/7/2025
3.0.65 335 3/7/2025
3.0.64 562 3/2/2025
3.0.63 368 3/2/2025
3.0.62 157 3/2/2025
3.0.61 247 3/2/2025
3.0.60 227 3/1/2025
3.0.59 287 3/1/2025
3.0.58 135 3/1/2025
3.0.57 210 3/1/2025
3.0.56 371 3/1/2025
3.0.55 143 3/1/2025
3.0.54 123 3/1/2025
3.0.53 127 3/1/2025
3.0.52 124 3/1/2025
3.0.51 267 3/1/2025
3.0.50 127 3/1/2025
3.0.49 471 2/25/2025
3.0.48 218 2/25/2025
3.0.47 219 2/25/2025
3.0.46 250 2/25/2025
3.0.45 149 2/25/2025
3.0.44 326 2/24/2025
3.0.43 239 2/23/2025
3.0.42 149 2/22/2025
3.0.41 426 2/22/2025
3.0.40 383 2/22/2025
3.0.39 298 2/22/2025
3.0.38 165 2/22/2025
3.0.37 244 2/22/2025
3.0.36 269 2/22/2025
3.0.35 147 2/21/2025
3.0.34 407 2/21/2025
3.0.33 242 2/21/2025
3.0.32 453 2/19/2025
3.0.31 603 2/18/2025
3.0.30 256 2/18/2025
3.0.29 352 2/18/2025
3.0.28 154 2/18/2025
3.0.27 487 2/14/2025
3.0.26 367 2/14/2025
3.0.25 256 2/13/2025
3.0.24 294 2/13/2025
3.0.23 443 2/12/2025
3.0.22 139 2/12/2025
3.0.21 275 2/12/2025
3.0.20 226 2/12/2025
3.0.19 354 2/11/2025
3.0.18 159 2/11/2025
3.0.17 440 2/11/2025
3.0.16 141 2/11/2025
3.0.15 244 2/11/2025
3.0.14 241 2/11/2025
3.0.13 154 2/11/2025
3.0.12 158 2/10/2025
3.0.11 130 2/10/2025
3.0.10 219 2/10/2025
3.0.9 255 2/10/2025
3.0.8 145 2/10/2025
3.0.7 137 2/10/2025
3.0.6 160 2/10/2025
3.0.5 133 2/10/2025
3.0.4 228 2/9/2025
3.0.3 373 2/9/2025
3.0.2 379 2/8/2025
3.0.1 376 2/7/2025