Soenneker.ConcurrentProcessing.Executor 3.0.166

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.166
                    
NuGet\Install-Package Soenneker.ConcurrentProcessing.Executor -Version 3.0.166
                    
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.166" />
                    
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.166" />
                    
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.166
                    
#r "nuget: Soenneker.ConcurrentProcessing.Executor, 3.0.166"
                    
#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.
#addin nuget:?package=Soenneker.ConcurrentProcessing.Executor&version=3.0.166
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.ConcurrentProcessing.Executor&version=3.0.166
                    
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.168 9 6/28/2025
3.0.167 10 6/27/2025
3.0.166 24 6/27/2025
3.0.165 21 6/27/2025
3.0.164 24 6/27/2025
3.0.163 905 6/10/2025
3.0.162 355 6/10/2025
3.0.161 310 6/10/2025
3.0.160 350 6/3/2025
3.0.159 596 5/27/2025
3.0.158 193 5/27/2025
3.0.157 134 5/27/2025
3.0.156 197 5/27/2025
3.0.155 792 5/23/2025
3.0.154 211 5/23/2025
3.0.153 136 5/23/2025
3.0.152 174 5/22/2025
3.0.151 614 5/14/2025
3.0.150 270 5/13/2025
3.0.149 683 5/8/2025
3.0.148 196 5/8/2025
3.0.147 134 5/8/2025
3.0.146 136 5/7/2025
3.0.145 395 5/5/2025
3.0.144 139 5/5/2025
3.0.143 128 5/5/2025
3.0.142 133 5/5/2025
3.0.141 136 5/5/2025
3.0.140 553 5/5/2025
3.0.139 1,338 4/8/2025
3.0.138 195 4/8/2025
3.0.137 159 4/8/2025
3.0.136 153 4/8/2025
3.0.135 152 4/8/2025
3.0.134 152 4/8/2025
3.0.133 151 4/8/2025
3.0.132 458 4/8/2025
3.0.131 290 4/8/2025
3.0.130 249 4/8/2025
3.0.129 345 4/8/2025
3.0.128 313 4/8/2025
3.0.127 266 4/7/2025
3.0.126 249 4/7/2025
3.0.125 417 4/7/2025
3.0.124 258 4/7/2025
3.0.123 367 4/7/2025
3.0.122 188 4/7/2025
3.0.121 141 4/7/2025
3.0.120 152 4/7/2025
3.0.119 141 4/6/2025
3.0.118 145 4/6/2025
3.0.117 169 4/6/2025
3.0.116 131 4/6/2025
3.0.115 130 4/6/2025
3.0.114 100 4/6/2025
3.0.113 87 4/6/2025
3.0.112 88 4/6/2025
3.0.111 108 4/6/2025
3.0.110 99 4/6/2025
3.0.109 97 4/6/2025
3.0.108 94 4/6/2025
3.0.107 70 4/5/2025
3.0.106 83 4/5/2025
3.0.105 83 4/5/2025
3.0.104 84 4/5/2025
3.0.103 79 4/5/2025
3.0.102 82 4/5/2025
3.0.101 86 4/5/2025
3.0.100 86 4/4/2025
3.0.99 81 4/4/2025
3.0.98 93 4/4/2025
3.0.97 1,974 4/3/2025
3.0.96 419 4/1/2025
3.0.95 267 4/1/2025
3.0.94 189 4/1/2025
3.0.93 393 3/31/2025
3.0.92 192 3/31/2025
3.0.91 345 3/31/2025
3.0.90 218 3/31/2025
3.0.89 209 3/29/2025
3.0.88 89 3/29/2025
3.0.87 128 3/29/2025
3.0.86 710 3/25/2025
3.0.85 523 3/25/2025
3.0.84 195 3/21/2025
3.0.83 219 3/21/2025
3.0.82 324 3/18/2025
3.0.81 239 3/18/2025
3.0.80 223 3/15/2025
3.0.79 114 3/15/2025
3.0.78 244 3/12/2025
3.0.77 160 3/12/2025
3.0.76 155 3/12/2025
3.0.75 167 3/12/2025
3.0.74 159 3/11/2025
3.0.73 174 3/11/2025
3.0.72 160 3/11/2025
3.0.71 398 3/11/2025
3.0.70 257 3/11/2025
3.0.69 221 3/11/2025
3.0.68 156 3/11/2025
3.0.67 234 3/11/2025
3.0.66 348 3/7/2025
3.0.65 261 3/7/2025
3.0.64 375 3/2/2025
3.0.63 226 3/2/2025
3.0.62 100 3/2/2025
3.0.61 156 3/2/2025
3.0.60 152 3/1/2025
3.0.59 193 3/1/2025
3.0.58 101 3/1/2025
3.0.57 145 3/1/2025
3.0.56 226 3/1/2025
3.0.55 94 3/1/2025
3.0.54 94 3/1/2025
3.0.53 92 3/1/2025
3.0.52 90 3/1/2025
3.0.51 172 3/1/2025
3.0.50 99 3/1/2025
3.0.49 300 2/25/2025
3.0.48 150 2/25/2025
3.0.47 151 2/25/2025
3.0.46 163 2/25/2025
3.0.45 100 2/25/2025
3.0.44 199 2/24/2025
3.0.43 172 2/23/2025
3.0.42 91 2/22/2025
3.0.41 275 2/22/2025
3.0.40 252 2/22/2025
3.0.39 197 2/22/2025
3.0.38 122 2/22/2025
3.0.37 161 2/22/2025
3.0.36 175 2/22/2025
3.0.35 103 2/21/2025
3.0.34 272 2/21/2025
3.0.33 161 2/21/2025
3.0.32 310 2/19/2025
3.0.31 401 2/18/2025
3.0.30 167 2/18/2025
3.0.29 235 2/18/2025
3.0.28 102 2/18/2025
3.0.27 328 2/14/2025
3.0.26 251 2/14/2025
3.0.25 185 2/13/2025
3.0.24 209 2/13/2025
3.0.23 316 2/12/2025
3.0.22 108 2/12/2025
3.0.21 179 2/12/2025
3.0.20 160 2/12/2025
3.0.19 227 2/11/2025
3.0.18 108 2/11/2025
3.0.17 288 2/11/2025
3.0.16 100 2/11/2025
3.0.15 162 2/11/2025
3.0.14 171 2/11/2025
3.0.13 103 2/11/2025
3.0.12 121 2/10/2025
3.0.11 106 2/10/2025
3.0.10 151 2/10/2025
3.0.9 163 2/10/2025
3.0.8 108 2/10/2025
3.0.7 105 2/10/2025
3.0.6 107 2/10/2025
3.0.5 101 2/10/2025
3.0.4 163 2/9/2025
3.0.3 230 2/9/2025
3.0.2 242 2/8/2025
3.0.1 234 2/7/2025