Soenneker.ConcurrentProcessing.Executor 3.0.105

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.105
                    
NuGet\Install-Package Soenneker.ConcurrentProcessing.Executor -Version 3.0.105
                    
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.105" />
                    
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.105" />
                    
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.105
                    
#r "nuget: Soenneker.ConcurrentProcessing.Executor, 3.0.105"
                    
#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.105
                    
#: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.105
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.ConcurrentProcessing.Executor&version=3.0.105
                    
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.180 84 8/20/2025
3.0.179 267 8/11/2025
3.0.178 157 8/11/2025
3.0.177 142 8/11/2025
3.0.176 112 8/11/2025
3.0.175 111 8/11/2025
3.0.174 544 8/5/2025
3.0.173 252 8/5/2025
3.0.172 216 8/5/2025
3.0.171 538 7/9/2025
3.0.170 197 7/8/2025
3.0.169 237 7/8/2025
3.0.168 964 6/28/2025
3.0.167 178 6/27/2025
3.0.166 80 6/27/2025
3.0.165 76 6/27/2025
3.0.164 170 6/27/2025
3.0.163 1,054 6/10/2025
3.0.162 364 6/10/2025
3.0.161 324 6/10/2025
3.0.160 360 6/3/2025
3.0.159 608 5/27/2025
3.0.158 207 5/27/2025
3.0.157 142 5/27/2025
3.0.156 205 5/27/2025
3.0.155 805 5/23/2025
3.0.154 220 5/23/2025
3.0.153 147 5/23/2025
3.0.152 184 5/22/2025
3.0.151 624 5/14/2025
3.0.150 280 5/13/2025
3.0.149 692 5/8/2025
3.0.148 204 5/8/2025
3.0.147 142 5/8/2025
3.0.146 148 5/7/2025
3.0.145 411 5/5/2025
3.0.144 151 5/5/2025
3.0.143 138 5/5/2025
3.0.142 140 5/5/2025
3.0.141 148 5/5/2025
3.0.140 563 5/5/2025
3.0.139 1,351 4/8/2025
3.0.138 210 4/8/2025
3.0.137 173 4/8/2025
3.0.136 164 4/8/2025
3.0.135 164 4/8/2025
3.0.134 162 4/8/2025
3.0.133 161 4/8/2025
3.0.132 472 4/8/2025
3.0.131 303 4/8/2025
3.0.130 264 4/8/2025
3.0.129 354 4/8/2025
3.0.128 325 4/8/2025
3.0.127 279 4/7/2025
3.0.126 264 4/7/2025
3.0.125 433 4/7/2025
3.0.124 274 4/7/2025
3.0.123 377 4/7/2025
3.0.122 196 4/7/2025
3.0.121 156 4/7/2025
3.0.120 165 4/7/2025
3.0.119 153 4/6/2025
3.0.118 157 4/6/2025
3.0.117 178 4/6/2025
3.0.116 149 4/6/2025
3.0.115 145 4/6/2025
3.0.114 116 4/6/2025
3.0.113 99 4/6/2025
3.0.112 100 4/6/2025
3.0.111 118 4/6/2025
3.0.110 112 4/6/2025
3.0.109 111 4/6/2025
3.0.108 104 4/6/2025
3.0.107 78 4/5/2025
3.0.106 92 4/5/2025
3.0.105 93 4/5/2025
3.0.104 92 4/5/2025
3.0.103 87 4/5/2025
3.0.102 97 4/5/2025
3.0.101 96 4/5/2025
3.0.100 96 4/4/2025
3.0.99 92 4/4/2025
3.0.98 106 4/4/2025
3.0.97 1,987 4/3/2025
3.0.96 430 4/1/2025
3.0.95 280 4/1/2025
3.0.94 200 4/1/2025
3.0.93 402 3/31/2025
3.0.92 202 3/31/2025
3.0.91 354 3/31/2025
3.0.90 232 3/31/2025
3.0.89 220 3/29/2025
3.0.88 98 3/29/2025
3.0.87 143 3/29/2025
3.0.86 723 3/25/2025
3.0.85 539 3/25/2025
3.0.84 209 3/21/2025
3.0.83 229 3/21/2025
3.0.82 338 3/18/2025
3.0.81 251 3/18/2025
3.0.80 232 3/15/2025
3.0.79 124 3/15/2025
3.0.78 259 3/12/2025
3.0.77 172 3/12/2025
3.0.76 167 3/12/2025
3.0.75 182 3/12/2025
3.0.74 171 3/11/2025
3.0.73 191 3/11/2025
3.0.72 175 3/11/2025
3.0.71 418 3/11/2025
3.0.70 272 3/11/2025
3.0.69 241 3/11/2025
3.0.68 169 3/11/2025
3.0.67 253 3/11/2025
3.0.66 359 3/7/2025
3.0.65 271 3/7/2025
3.0.64 386 3/2/2025
3.0.63 245 3/2/2025
3.0.62 113 3/2/2025
3.0.61 172 3/2/2025
3.0.60 160 3/1/2025
3.0.59 201 3/1/2025
3.0.58 110 3/1/2025
3.0.57 157 3/1/2025
3.0.56 240 3/1/2025
3.0.55 108 3/1/2025
3.0.54 102 3/1/2025
3.0.53 104 3/1/2025
3.0.52 101 3/1/2025
3.0.51 182 3/1/2025
3.0.50 105 3/1/2025
3.0.49 308 2/25/2025
3.0.48 158 2/25/2025
3.0.47 160 2/25/2025
3.0.46 176 2/25/2025
3.0.45 114 2/25/2025
3.0.44 213 2/24/2025
3.0.43 180 2/23/2025
3.0.42 110 2/22/2025
3.0.41 284 2/22/2025
3.0.40 264 2/22/2025
3.0.39 205 2/22/2025
3.0.38 130 2/22/2025
3.0.37 173 2/22/2025
3.0.36 190 2/22/2025
3.0.35 114 2/21/2025
3.0.34 282 2/21/2025
3.0.33 173 2/21/2025
3.0.32 318 2/19/2025
3.0.31 411 2/18/2025
3.0.30 180 2/18/2025
3.0.29 248 2/18/2025
3.0.28 116 2/18/2025
3.0.27 338 2/14/2025
3.0.26 260 2/14/2025
3.0.25 199 2/13/2025
3.0.24 218 2/13/2025
3.0.23 326 2/12/2025
3.0.22 116 2/12/2025
3.0.21 189 2/12/2025
3.0.20 176 2/12/2025
3.0.19 242 2/11/2025
3.0.18 124 2/11/2025
3.0.17 300 2/11/2025
3.0.16 111 2/11/2025
3.0.15 177 2/11/2025
3.0.14 179 2/11/2025
3.0.13 118 2/11/2025
3.0.12 129 2/10/2025
3.0.11 115 2/10/2025
3.0.10 163 2/10/2025
3.0.9 175 2/10/2025
3.0.8 119 2/10/2025
3.0.7 114 2/10/2025
3.0.6 124 2/10/2025
3.0.5 109 2/10/2025
3.0.4 172 2/9/2025
3.0.3 245 2/9/2025
3.0.2 255 2/8/2025
3.0.1 253 2/7/2025