Soenneker.ConcurrentProcessing.Executor 3.0.7

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.7
                    
NuGet\Install-Package Soenneker.ConcurrentProcessing.Executor -Version 3.0.7
                    
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.7" />
                    
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.7" />
                    
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.7
                    
#r "nuget: Soenneker.ConcurrentProcessing.Executor, 3.0.7"
                    
#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.7
                    
#: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.7
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.ConcurrentProcessing.Executor&version=3.0.7
                    
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.216 0 12/21/2025
4.0.215 0 12/21/2025
4.0.214 430 12/17/2025
4.0.213 405 12/15/2025
4.0.212 242 12/15/2025
4.0.211 513 12/12/2025
4.0.210 649 12/10/2025
4.0.209 420 12/10/2025
4.0.208 997 11/21/2025
4.0.207 389 11/21/2025
4.0.206 381 11/20/2025
4.0.205 383 11/20/2025
4.0.204 1,221 11/11/2025
4.0.203 338 11/11/2025
4.0.202 794 11/6/2025
4.0.201 252 11/6/2025
4.0.200 590 11/3/2025
4.0.199 181 11/3/2025
4.0.198 584 10/30/2025
4.0.197 319 10/30/2025
4.0.196 185 10/30/2025
4.0.195 235 10/30/2025
4.0.194 183 10/29/2025
3.0.193 938 10/16/2025
3.0.192 175 10/16/2025
3.0.191 1,972 9/10/2025
3.0.190 485 9/9/2025
3.0.189 175 9/9/2025
3.0.188 296 9/9/2025
3.0.187 905 9/3/2025
3.0.186 174 9/3/2025
3.0.185 430 9/3/2025
3.0.184 178 9/3/2025
3.0.183 186 9/3/2025
3.0.182 188 9/3/2025
3.0.181 190 9/3/2025
3.0.180 728 8/20/2025
3.0.179 1,377 8/11/2025
3.0.178 290 8/11/2025
3.0.177 236 8/11/2025
3.0.176 175 8/11/2025
3.0.175 173 8/11/2025
3.0.174 1,155 8/5/2025
3.0.173 364 8/5/2025
3.0.172 313 8/5/2025
3.0.171 1,423 7/9/2025
3.0.170 267 7/8/2025
3.0.169 329 7/8/2025
3.0.168 1,459 6/28/2025
3.0.167 307 6/27/2025
3.0.166 114 6/27/2025
3.0.165 110 6/27/2025
3.0.164 261 6/27/2025
3.0.163 1,519 6/10/2025
3.0.162 458 6/10/2025
3.0.161 382 6/10/2025
3.0.160 469 6/3/2025
3.0.159 945 5/27/2025
3.0.158 303 5/27/2025
3.0.157 175 5/27/2025
3.0.156 279 5/27/2025
3.0.155 1,334 5/23/2025
3.0.154 295 5/23/2025
3.0.153 207 5/23/2025
3.0.152 268 5/22/2025
3.0.151 905 5/14/2025
3.0.150 344 5/13/2025
3.0.149 1,091 5/8/2025
3.0.148 313 5/8/2025
3.0.147 170 5/8/2025
3.0.146 206 5/7/2025
3.0.145 617 5/5/2025
3.0.144 188 5/5/2025
3.0.143 166 5/5/2025
3.0.142 171 5/5/2025
3.0.141 194 5/5/2025
3.0.140 871 5/5/2025
3.0.139 1,972 4/8/2025
3.0.138 290 4/8/2025
3.0.137 204 4/8/2025
3.0.136 200 4/8/2025
3.0.135 204 4/8/2025
3.0.134 220 4/8/2025
3.0.133 199 4/8/2025
3.0.132 711 4/8/2025
3.0.131 440 4/8/2025
3.0.130 358 4/8/2025
3.0.129 534 4/8/2025
3.0.128 495 4/8/2025
3.0.127 404 4/7/2025
3.0.126 356 4/7/2025
3.0.125 645 4/7/2025
3.0.124 393 4/7/2025
3.0.123 535 4/7/2025
3.0.122 243 4/7/2025
3.0.121 208 4/7/2025
3.0.120 205 4/7/2025
3.0.119 183 4/6/2025
3.0.118 204 4/6/2025
3.0.117 210 4/6/2025
3.0.116 200 4/6/2025
3.0.115 184 4/6/2025
3.0.114 164 4/6/2025
3.0.113 160 4/6/2025
3.0.112 133 4/6/2025
3.0.111 169 4/6/2025
3.0.110 164 4/6/2025
3.0.109 163 4/6/2025
3.0.108 142 4/6/2025
3.0.107 116 4/5/2025
3.0.106 124 4/5/2025
3.0.105 125 4/5/2025
3.0.104 126 4/5/2025
3.0.103 119 4/5/2025
3.0.102 141 4/5/2025
3.0.101 128 4/5/2025
3.0.100 130 4/4/2025
3.0.99 137 4/4/2025
3.0.98 163 4/4/2025
3.0.97 3,083 4/3/2025
3.0.96 688 4/1/2025
3.0.95 392 4/1/2025
3.0.94 265 4/1/2025
3.0.93 621 3/31/2025
3.0.92 253 3/31/2025
3.0.91 496 3/31/2025
3.0.90 314 3/31/2025
3.0.89 353 3/29/2025
3.0.88 127 3/29/2025
3.0.87 226 3/29/2025
3.0.86 950 3/25/2025
3.0.85 628 3/25/2025
3.0.84 332 3/21/2025
3.0.83 343 3/21/2025
3.0.82 489 3/18/2025
3.0.81 374 3/18/2025
3.0.80 406 3/15/2025
3.0.79 194 3/15/2025
3.0.78 371 3/12/2025
3.0.77 206 3/12/2025
3.0.76 217 3/12/2025
3.0.75 227 3/12/2025
3.0.74 213 3/11/2025
3.0.73 248 3/11/2025
3.0.72 611 3/11/2025
3.0.71 639 3/11/2025
3.0.70 403 3/11/2025
3.0.69 325 3/11/2025
3.0.68 214 3/11/2025
3.0.67 343 3/11/2025
3.0.66 496 3/7/2025
3.0.65 343 3/7/2025
3.0.64 577 3/2/2025
3.0.63 392 3/2/2025
3.0.62 172 3/2/2025
3.0.61 267 3/2/2025
3.0.60 237 3/1/2025
3.0.59 299 3/1/2025
3.0.58 146 3/1/2025
3.0.57 234 3/1/2025
3.0.56 396 3/1/2025
3.0.55 161 3/1/2025
3.0.54 132 3/1/2025
3.0.53 145 3/1/2025
3.0.52 134 3/1/2025
3.0.51 282 3/1/2025
3.0.50 139 3/1/2025
3.0.49 491 2/25/2025
3.0.48 233 2/25/2025
3.0.47 233 2/25/2025
3.0.46 269 2/25/2025
3.0.45 163 2/25/2025
3.0.44 344 2/24/2025
3.0.43 253 2/23/2025
3.0.42 168 2/22/2025
3.0.41 448 2/22/2025
3.0.40 409 2/22/2025
3.0.39 317 2/22/2025
3.0.38 176 2/22/2025
3.0.37 278 2/22/2025
3.0.36 285 2/22/2025
3.0.35 161 2/21/2025
3.0.34 428 2/21/2025
3.0.33 260 2/21/2025
3.0.32 472 2/19/2025
3.0.31 621 2/18/2025
3.0.30 279 2/18/2025
3.0.29 376 2/18/2025
3.0.28 172 2/18/2025
3.0.27 499 2/14/2025
3.0.26 383 2/14/2025
3.0.25 276 2/13/2025
3.0.24 306 2/13/2025
3.0.23 461 2/12/2025
3.0.22 147 2/12/2025
3.0.21 284 2/12/2025
3.0.20 244 2/12/2025
3.0.19 370 2/11/2025
3.0.18 172 2/11/2025
3.0.17 451 2/11/2025
3.0.16 153 2/11/2025
3.0.15 260 2/11/2025
3.0.14 247 2/11/2025
3.0.13 168 2/11/2025
3.0.12 165 2/10/2025
3.0.11 137 2/10/2025
3.0.10 229 2/10/2025
3.0.9 278 2/10/2025
3.0.8 152 2/10/2025
3.0.7 146 2/10/2025
3.0.6 176 2/10/2025
3.0.5 144 2/10/2025
3.0.4 238 2/9/2025
3.0.3 390 2/9/2025
3.0.2 402 2/8/2025
3.0.1 400 2/7/2025