Soenneker.ConcurrentProcessing.Executor 3.0.95

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.95
                    
NuGet\Install-Package Soenneker.ConcurrentProcessing.Executor -Version 3.0.95
                    
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.95" />
                    
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.95" />
                    
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.95
                    
#r "nuget: Soenneker.ConcurrentProcessing.Executor, 3.0.95"
                    
#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.95
                    
#: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.95
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.ConcurrentProcessing.Executor&version=3.0.95
                    
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.208 635 11/21/2025
4.0.207 340 11/21/2025
4.0.206 355 11/20/2025
4.0.205 355 11/20/2025
4.0.204 1,195 11/11/2025
4.0.203 330 11/11/2025
4.0.202 785 11/6/2025
4.0.201 249 11/6/2025
4.0.200 586 11/3/2025
4.0.199 176 11/3/2025
4.0.198 580 10/30/2025
4.0.197 315 10/30/2025
4.0.196 182 10/30/2025
4.0.195 231 10/30/2025
4.0.194 178 10/29/2025
3.0.193 934 10/16/2025
3.0.192 170 10/16/2025
3.0.191 1,967 9/10/2025
3.0.190 484 9/9/2025
3.0.189 173 9/9/2025
3.0.188 292 9/9/2025
3.0.187 903 9/3/2025
3.0.186 172 9/3/2025
3.0.185 426 9/3/2025
3.0.184 177 9/3/2025
3.0.183 182 9/3/2025
3.0.182 182 9/3/2025
3.0.181 185 9/3/2025
3.0.180 724 8/20/2025
3.0.179 1,366 8/11/2025
3.0.178 286 8/11/2025
3.0.177 233 8/11/2025
3.0.176 171 8/11/2025
3.0.175 168 8/11/2025
3.0.174 1,151 8/5/2025
3.0.173 358 8/5/2025
3.0.172 312 8/5/2025
3.0.171 1,419 7/9/2025
3.0.170 264 7/8/2025
3.0.169 327 7/8/2025
3.0.168 1,447 6/28/2025
3.0.167 301 6/27/2025
3.0.166 112 6/27/2025
3.0.165 109 6/27/2025
3.0.164 254 6/27/2025
3.0.163 1,517 6/10/2025
3.0.162 456 6/10/2025
3.0.161 380 6/10/2025
3.0.160 468 6/3/2025
3.0.159 941 5/27/2025
3.0.158 302 5/27/2025
3.0.157 172 5/27/2025
3.0.156 274 5/27/2025
3.0.155 1,328 5/23/2025
3.0.154 293 5/23/2025
3.0.153 202 5/23/2025
3.0.152 264 5/22/2025
3.0.151 900 5/14/2025
3.0.150 342 5/13/2025
3.0.149 1,087 5/8/2025
3.0.148 310 5/8/2025
3.0.147 163 5/8/2025
3.0.146 202 5/7/2025
3.0.145 616 5/5/2025
3.0.144 185 5/5/2025
3.0.143 165 5/5/2025
3.0.142 169 5/5/2025
3.0.141 193 5/5/2025
3.0.140 864 5/5/2025
3.0.139 1,963 4/8/2025
3.0.138 288 4/8/2025
3.0.137 201 4/8/2025
3.0.136 196 4/8/2025
3.0.135 202 4/8/2025
3.0.134 212 4/8/2025
3.0.133 193 4/8/2025
3.0.132 707 4/8/2025
3.0.131 437 4/8/2025
3.0.130 355 4/8/2025
3.0.129 529 4/8/2025
3.0.128 489 4/8/2025
3.0.127 402 4/7/2025
3.0.126 355 4/7/2025
3.0.125 641 4/7/2025
3.0.124 391 4/7/2025
3.0.123 534 4/7/2025
3.0.122 240 4/7/2025
3.0.121 207 4/7/2025
3.0.120 199 4/7/2025
3.0.119 183 4/6/2025
3.0.118 201 4/6/2025
3.0.117 206 4/6/2025
3.0.116 196 4/6/2025
3.0.115 182 4/6/2025
3.0.114 159 4/6/2025
3.0.113 157 4/6/2025
3.0.112 131 4/6/2025
3.0.111 167 4/6/2025
3.0.110 161 4/6/2025
3.0.109 156 4/6/2025
3.0.108 138 4/6/2025
3.0.107 112 4/5/2025
3.0.106 120 4/5/2025
3.0.105 120 4/5/2025
3.0.104 123 4/5/2025
3.0.103 116 4/5/2025
3.0.102 140 4/5/2025
3.0.101 124 4/5/2025
3.0.100 127 4/4/2025
3.0.99 135 4/4/2025
3.0.98 159 4/4/2025
3.0.97 3,069 4/3/2025
3.0.96 684 4/1/2025
3.0.95 388 4/1/2025
3.0.94 258 4/1/2025
3.0.93 611 3/31/2025
3.0.92 251 3/31/2025
3.0.91 495 3/31/2025
3.0.90 310 3/31/2025
3.0.89 344 3/29/2025
3.0.88 126 3/29/2025
3.0.87 224 3/29/2025
3.0.86 947 3/25/2025
3.0.85 625 3/25/2025
3.0.84 328 3/21/2025
3.0.83 337 3/21/2025
3.0.82 485 3/18/2025
3.0.81 369 3/18/2025
3.0.80 394 3/15/2025
3.0.79 182 3/15/2025
3.0.78 369 3/12/2025
3.0.77 202 3/12/2025
3.0.76 212 3/12/2025
3.0.75 224 3/12/2025
3.0.74 208 3/11/2025
3.0.73 244 3/11/2025
3.0.72 295 3/11/2025
3.0.71 633 3/11/2025
3.0.70 397 3/11/2025
3.0.69 316 3/11/2025
3.0.68 211 3/11/2025
3.0.67 338 3/11/2025
3.0.66 488 3/7/2025
3.0.65 339 3/7/2025
3.0.64 572 3/2/2025
3.0.63 386 3/2/2025
3.0.62 169 3/2/2025
3.0.61 264 3/2/2025
3.0.60 235 3/1/2025
3.0.59 295 3/1/2025
3.0.58 144 3/1/2025
3.0.57 226 3/1/2025
3.0.56 393 3/1/2025
3.0.55 158 3/1/2025
3.0.54 130 3/1/2025
3.0.53 140 3/1/2025
3.0.52 131 3/1/2025
3.0.51 278 3/1/2025
3.0.50 132 3/1/2025
3.0.49 488 2/25/2025
3.0.48 224 2/25/2025
3.0.47 230 2/25/2025
3.0.46 263 2/25/2025
3.0.45 160 2/25/2025
3.0.44 341 2/24/2025
3.0.43 246 2/23/2025
3.0.42 162 2/22/2025
3.0.41 441 2/22/2025
3.0.40 402 2/22/2025
3.0.39 309 2/22/2025
3.0.38 172 2/22/2025
3.0.37 272 2/22/2025
3.0.36 281 2/22/2025
3.0.35 159 2/21/2025
3.0.34 422 2/21/2025
3.0.33 255 2/21/2025
3.0.32 463 2/19/2025
3.0.31 615 2/18/2025
3.0.30 276 2/18/2025
3.0.29 371 2/18/2025
3.0.28 167 2/18/2025
3.0.27 494 2/14/2025
3.0.26 379 2/14/2025
3.0.25 266 2/13/2025
3.0.24 303 2/13/2025
3.0.23 458 2/12/2025
3.0.22 142 2/12/2025
3.0.21 280 2/12/2025
3.0.20 236 2/12/2025
3.0.19 364 2/11/2025
3.0.18 168 2/11/2025
3.0.17 446 2/11/2025
3.0.16 150 2/11/2025
3.0.15 255 2/11/2025
3.0.14 244 2/11/2025
3.0.13 166 2/11/2025
3.0.12 163 2/10/2025
3.0.11 134 2/10/2025
3.0.10 225 2/10/2025
3.0.9 276 2/10/2025
3.0.8 148 2/10/2025
3.0.7 144 2/10/2025
3.0.6 170 2/10/2025
3.0.5 140 2/10/2025
3.0.4 235 2/9/2025
3.0.3 384 2/9/2025
3.0.2 394 2/8/2025
3.0.1 391 2/7/2025