Soenneker.ConcurrentProcessing.Executor 3.0.147

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.147
                    
NuGet\Install-Package Soenneker.ConcurrentProcessing.Executor -Version 3.0.147
                    
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.147" />
                    
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.147" />
                    
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.147
                    
#r "nuget: Soenneker.ConcurrentProcessing.Executor, 3.0.147"
                    
#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.147
                    
#: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.147
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.ConcurrentProcessing.Executor&version=3.0.147
                    
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.191 631 9/10/2025
3.0.190 354 9/9/2025
3.0.189 145 9/9/2025
3.0.188 224 9/9/2025
3.0.187 632 9/3/2025
3.0.186 152 9/3/2025
3.0.185 332 9/3/2025
3.0.184 155 9/3/2025
3.0.183 159 9/3/2025
3.0.182 161 9/3/2025
3.0.181 159 9/3/2025
3.0.180 543 8/20/2025
3.0.179 1,006 8/11/2025
3.0.178 231 8/11/2025
3.0.177 199 8/11/2025
3.0.176 146 8/11/2025
3.0.175 145 8/11/2025
3.0.174 879 8/5/2025
3.0.173 308 8/5/2025
3.0.172 263 8/5/2025
3.0.171 1,052 7/9/2025
3.0.170 229 7/8/2025
3.0.169 275 7/8/2025
3.0.168 1,173 6/28/2025
3.0.167 228 6/27/2025
3.0.166 93 6/27/2025
3.0.165 89 6/27/2025
3.0.164 203 6/27/2025
3.0.163 1,242 6/10/2025
3.0.162 399 6/10/2025
3.0.161 349 6/10/2025
3.0.160 401 6/3/2025
3.0.159 739 5/27/2025
3.0.158 241 5/27/2025
3.0.157 154 5/27/2025
3.0.156 226 5/27/2025
3.0.155 1,017 5/23/2025
3.0.154 249 5/23/2025
3.0.153 168 5/23/2025
3.0.152 219 5/22/2025
3.0.151 737 5/14/2025
3.0.150 301 5/13/2025
3.0.149 853 5/8/2025
3.0.148 245 5/8/2025
3.0.147 155 5/8/2025
3.0.146 164 5/7/2025
3.0.145 502 5/5/2025
3.0.144 165 5/5/2025
3.0.143 149 5/5/2025
3.0.142 151 5/5/2025
3.0.141 164 5/5/2025
3.0.140 699 5/5/2025
3.0.139 1,607 4/8/2025
3.0.138 240 4/8/2025
3.0.137 189 4/8/2025
3.0.136 176 4/8/2025
3.0.135 182 4/8/2025
3.0.134 180 4/8/2025
3.0.133 174 4/8/2025
3.0.132 552 4/8/2025
3.0.131 352 4/8/2025
3.0.130 302 4/8/2025
3.0.129 421 4/8/2025
3.0.128 398 4/8/2025
3.0.127 330 4/7/2025
3.0.126 295 4/7/2025
3.0.125 531 4/7/2025
3.0.124 321 4/7/2025
3.0.123 455 4/7/2025
3.0.122 216 4/7/2025
3.0.121 174 4/7/2025
3.0.120 184 4/7/2025
3.0.119 164 4/6/2025
3.0.118 175 4/6/2025
3.0.117 189 4/6/2025
3.0.116 167 4/6/2025
3.0.115 159 4/6/2025
3.0.114 141 4/6/2025
3.0.113 117 4/6/2025
3.0.112 107 4/6/2025
3.0.111 139 4/6/2025
3.0.110 129 4/6/2025
3.0.109 127 4/6/2025
3.0.108 117 4/6/2025
3.0.107 90 4/5/2025
3.0.106 103 4/5/2025
3.0.105 104 4/5/2025
3.0.104 106 4/5/2025
3.0.103 99 4/5/2025
3.0.102 112 4/5/2025
3.0.101 108 4/5/2025
3.0.100 108 4/4/2025
3.0.99 108 4/4/2025
3.0.98 127 4/4/2025
3.0.97 2,461 4/3/2025
3.0.96 533 4/1/2025
3.0.95 329 4/1/2025
3.0.94 223 4/1/2025
3.0.93 502 3/31/2025
3.0.92 222 3/31/2025
3.0.91 423 3/31/2025
3.0.90 263 3/31/2025
3.0.89 271 3/29/2025
3.0.88 109 3/29/2025
3.0.87 173 3/29/2025
3.0.86 820 3/25/2025
3.0.85 574 3/25/2025
3.0.84 260 3/21/2025
3.0.83 282 3/21/2025
3.0.82 409 3/18/2025
3.0.81 304 3/18/2025
3.0.80 304 3/15/2025
3.0.79 145 3/15/2025
3.0.78 305 3/12/2025
3.0.77 184 3/12/2025
3.0.76 185 3/12/2025
3.0.75 196 3/12/2025
3.0.74 183 3/11/2025
3.0.73 212 3/11/2025
3.0.72 219 3/11/2025
3.0.71 511 3/11/2025
3.0.70 320 3/11/2025
3.0.69 266 3/11/2025
3.0.68 184 3/11/2025
3.0.67 284 3/11/2025
3.0.66 404 3/7/2025
3.0.65 299 3/7/2025
3.0.64 434 3/2/2025
3.0.63 299 3/2/2025
3.0.62 136 3/2/2025
3.0.61 197 3/2/2025
3.0.60 186 3/1/2025
3.0.59 235 3/1/2025
3.0.58 120 3/1/2025
3.0.57 177 3/1/2025
3.0.56 286 3/1/2025
3.0.55 126 3/1/2025
3.0.54 112 3/1/2025
3.0.53 112 3/1/2025
3.0.52 112 3/1/2025
3.0.51 220 3/1/2025
3.0.50 116 3/1/2025
3.0.49 380 2/25/2025
3.0.48 174 2/25/2025
3.0.47 189 2/25/2025
3.0.46 203 2/25/2025
3.0.45 133 2/25/2025
3.0.44 257 2/24/2025
3.0.43 203 2/23/2025
3.0.42 130 2/22/2025
3.0.41 308 2/22/2025
3.0.40 312 2/22/2025
3.0.39 249 2/22/2025
3.0.38 147 2/22/2025
3.0.37 198 2/22/2025
3.0.36 223 2/22/2025
3.0.35 131 2/21/2025
3.0.34 332 2/21/2025
3.0.33 201 2/21/2025
3.0.32 381 2/19/2025
3.0.31 496 2/18/2025
3.0.30 215 2/18/2025
3.0.29 291 2/18/2025
3.0.28 135 2/18/2025
3.0.27 398 2/14/2025
3.0.26 296 2/14/2025
3.0.25 224 2/13/2025
3.0.24 254 2/13/2025
3.0.23 370 2/12/2025
3.0.22 128 2/12/2025
3.0.21 219 2/12/2025
3.0.20 195 2/12/2025
3.0.19 296 2/11/2025
3.0.18 142 2/11/2025
3.0.17 365 2/11/2025
3.0.16 126 2/11/2025
3.0.15 200 2/11/2025
3.0.14 209 2/11/2025
3.0.13 134 2/11/2025
3.0.12 141 2/10/2025
3.0.11 118 2/10/2025
3.0.10 191 2/10/2025
3.0.9 220 2/10/2025
3.0.8 130 2/10/2025
3.0.7 126 2/10/2025
3.0.6 144 2/10/2025
3.0.5 121 2/10/2025
3.0.4 198 2/9/2025
3.0.3 308 2/9/2025
3.0.2 313 2/8/2025
3.0.1 315 2/7/2025