Soenneker.ConcurrentProcessing.Executor 3.0.128

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.128
                    
NuGet\Install-Package Soenneker.ConcurrentProcessing.Executor -Version 3.0.128
                    
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.128" />
                    
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.128" />
                    
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.128
                    
#r "nuget: Soenneker.ConcurrentProcessing.Executor, 3.0.128"
                    
#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.128
                    
#: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.128
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.ConcurrentProcessing.Executor&version=3.0.128
                    
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.241 369 1/22/2026
4.0.240 1,110 1/14/2026
4.0.239 180 1/14/2026
4.0.238 91 1/13/2026
4.0.237 572 1/12/2026
4.0.236 83 1/12/2026
4.0.235 304 1/9/2026
4.0.234 379 1/8/2026
4.0.233 87 1/8/2026
4.0.232 161 1/8/2026
4.0.231 409 1/7/2026
4.0.230 425 1/6/2026
4.0.228 192 1/6/2026
4.0.227 86 1/6/2026
4.0.226 288 1/5/2026
4.0.225 534 1/3/2026
4.0.224 85 1/3/2026
4.0.223 266 1/3/2026
4.0.222 94 1/3/2026
4.0.221 87 1/2/2026
4.0.220 223 1/2/2026
4.0.219 87 1/2/2026
4.0.218 362 12/31/2025
4.0.217 197 12/31/2025
4.0.216 645 12/21/2025
4.0.215 122 12/21/2025
4.0.214 674 12/17/2025
4.0.213 420 12/15/2025
4.0.212 251 12/15/2025
4.0.211 530 12/12/2025
4.0.210 667 12/10/2025
4.0.209 437 12/10/2025
4.0.208 1,012 11/21/2025
4.0.207 405 11/21/2025
4.0.206 394 11/20/2025
4.0.205 395 11/20/2025
4.0.204 1,237 11/11/2025
4.0.203 360 11/11/2025
4.0.202 808 11/6/2025
4.0.201 261 11/6/2025
4.0.200 604 11/3/2025
4.0.199 198 11/3/2025
4.0.198 597 10/30/2025
4.0.197 335 10/30/2025
4.0.196 197 10/30/2025
4.0.195 252 10/30/2025
4.0.194 196 10/29/2025
3.0.193 961 10/16/2025
3.0.192 196 10/16/2025
3.0.191 1,990 9/10/2025
3.0.190 504 9/9/2025
3.0.189 192 9/9/2025
3.0.188 312 9/9/2025
3.0.187 923 9/3/2025
3.0.186 192 9/3/2025
3.0.185 446 9/3/2025
3.0.184 192 9/3/2025
3.0.183 202 9/3/2025
3.0.182 199 9/3/2025
3.0.181 204 9/3/2025
3.0.180 742 8/20/2025
3.0.179 1,391 8/11/2025
3.0.178 301 8/11/2025
3.0.177 249 8/11/2025
3.0.176 191 8/11/2025
3.0.175 187 8/11/2025
3.0.174 1,171 8/5/2025
3.0.173 376 8/5/2025
3.0.172 330 8/5/2025
3.0.171 1,442 7/9/2025
3.0.170 277 7/8/2025
3.0.169 344 7/8/2025
3.0.168 1,480 6/28/2025
3.0.167 324 6/27/2025
3.0.166 129 6/27/2025
3.0.165 122 6/27/2025
3.0.164 275 6/27/2025
3.0.163 1,529 6/10/2025
3.0.162 472 6/10/2025
3.0.161 404 6/10/2025
3.0.160 485 6/3/2025
3.0.159 960 5/27/2025
3.0.158 319 5/27/2025
3.0.157 185 5/27/2025
3.0.156 290 5/27/2025
3.0.155 1,351 5/23/2025
3.0.154 306 5/23/2025
3.0.153 214 5/23/2025
3.0.152 277 5/22/2025
3.0.151 921 5/14/2025
3.0.150 357 5/13/2025
3.0.149 1,112 5/8/2025
3.0.148 336 5/8/2025
3.0.147 185 5/8/2025
3.0.146 215 5/7/2025
3.0.145 627 5/5/2025
3.0.144 203 5/5/2025
3.0.143 176 5/5/2025
3.0.142 182 5/5/2025
3.0.141 211 5/5/2025
3.0.140 891 5/5/2025
3.0.139 1,987 4/8/2025
3.0.138 308 4/8/2025
3.0.137 222 4/8/2025
3.0.136 215 4/8/2025
3.0.135 219 4/8/2025
3.0.134 238 4/8/2025
3.0.133 213 4/8/2025
3.0.132 731 4/8/2025
3.0.131 458 4/8/2025
3.0.130 368 4/8/2025
3.0.129 543 4/8/2025
3.0.128 507 4/8/2025
3.0.127 418 4/7/2025
3.0.126 365 4/7/2025
3.0.125 663 4/7/2025
3.0.124 412 4/7/2025
3.0.123 547 4/7/2025
3.0.122 258 4/7/2025
3.0.121 216 4/7/2025
3.0.120 221 4/7/2025
3.0.119 193 4/6/2025
3.0.118 216 4/6/2025
3.0.117 221 4/6/2025
3.0.116 214 4/6/2025
3.0.115 194 4/6/2025
3.0.114 176 4/6/2025
3.0.113 171 4/6/2025
3.0.112 144 4/6/2025
3.0.111 183 4/6/2025
3.0.110 171 4/6/2025
3.0.109 171 4/6/2025
3.0.108 153 4/6/2025
3.0.107 130 4/5/2025
3.0.106 136 4/5/2025
3.0.105 138 4/5/2025
3.0.104 143 4/5/2025
3.0.103 130 4/5/2025
3.0.102 154 4/5/2025
3.0.101 141 4/5/2025
3.0.100 146 4/4/2025
3.0.99 147 4/4/2025
3.0.98 169 4/4/2025
3.0.97 3,098 4/3/2025
3.0.96 701 4/1/2025
3.0.95 406 4/1/2025
3.0.94 282 4/1/2025
3.0.93 630 3/31/2025
3.0.92 267 3/31/2025
3.0.91 509 3/31/2025
3.0.90 322 3/31/2025
3.0.89 359 3/29/2025
3.0.88 145 3/29/2025
3.0.87 248 3/29/2025
3.0.86 960 3/25/2025
3.0.85 644 3/25/2025
3.0.84 349 3/21/2025
3.0.83 362 3/21/2025
3.0.82 509 3/18/2025
3.0.81 389 3/18/2025
3.0.80 428 3/15/2025
3.0.79 207 3/15/2025
3.0.78 396 3/12/2025
3.0.77 218 3/12/2025
3.0.76 231 3/12/2025
3.0.75 238 3/12/2025
3.0.74 225 3/11/2025
3.0.73 261 3/11/2025
3.0.72 691 3/11/2025
3.0.71 653 3/11/2025
3.0.70 412 3/11/2025
3.0.69 337 3/11/2025
3.0.68 219 3/11/2025
3.0.67 354 3/11/2025
3.0.66 508 3/7/2025
3.0.65 353 3/7/2025
3.0.64 588 3/2/2025
3.0.63 408 3/2/2025
3.0.62 183 3/2/2025
3.0.61 275 3/2/2025
3.0.60 245 3/1/2025
3.0.59 315 3/1/2025
3.0.58 151 3/1/2025
3.0.57 247 3/1/2025
3.0.56 403 3/1/2025
3.0.55 174 3/1/2025
3.0.54 142 3/1/2025
3.0.53 157 3/1/2025
3.0.52 145 3/1/2025
3.0.51 290 3/1/2025
3.0.50 151 3/1/2025
3.0.49 504 2/25/2025
3.0.48 249 2/25/2025
3.0.47 248 2/25/2025
3.0.46 282 2/25/2025
3.0.45 176 2/25/2025
3.0.44 357 2/24/2025
3.0.43 267 2/23/2025
3.0.42 184 2/22/2025
3.0.41 461 2/22/2025
3.0.40 421 2/22/2025
3.0.39 329 2/22/2025
3.0.38 194 2/22/2025
3.0.37 291 2/22/2025
3.0.36 306 2/22/2025
3.0.35 173 2/21/2025
3.0.34 437 2/21/2025
3.0.33 276 2/21/2025
3.0.32 486 2/19/2025
3.0.31 635 2/18/2025
3.0.30 292 2/18/2025
3.0.29 393 2/18/2025
3.0.28 184 2/18/2025
3.0.27 511 2/14/2025
3.0.26 402 2/14/2025
3.0.25 294 2/13/2025
3.0.24 322 2/13/2025
3.0.23 482 2/12/2025
3.0.22 164 2/12/2025
3.0.21 300 2/12/2025
3.0.20 260 2/12/2025
3.0.19 384 2/11/2025
3.0.18 187 2/11/2025
3.0.17 465 2/11/2025
3.0.16 165 2/11/2025
3.0.15 274 2/11/2025
3.0.14 258 2/11/2025
3.0.13 179 2/11/2025
3.0.12 182 2/10/2025
3.0.11 150 2/10/2025
3.0.10 237 2/10/2025
3.0.9 298 2/10/2025
3.0.8 169 2/10/2025
3.0.7 159 2/10/2025
3.0.6 189 2/10/2025
3.0.5 159 2/10/2025
3.0.4 251 2/9/2025
3.0.3 402 2/9/2025
3.0.2 419 2/8/2025
3.0.1 418 2/7/2025