Soenneker.Utils.RateLimiting.Executor 3.0.371

Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package Soenneker.Utils.RateLimiting.Executor --version 3.0.371
                    
NuGet\Install-Package Soenneker.Utils.RateLimiting.Executor -Version 3.0.371
                    
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.Utils.RateLimiting.Executor" Version="3.0.371" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soenneker.Utils.RateLimiting.Executor" Version="3.0.371" />
                    
Directory.Packages.props
<PackageReference Include="Soenneker.Utils.RateLimiting.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.Utils.RateLimiting.Executor --version 3.0.371
                    
#r "nuget: Soenneker.Utils.RateLimiting.Executor, 3.0.371"
                    
#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.Utils.RateLimiting.Executor@3.0.371
                    
#: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.Utils.RateLimiting.Executor&version=3.0.371
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.Utils.RateLimiting.Executor&version=3.0.371
                    
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.Utils.RateLimiting.Executor

A thread-safe utility designed to manage the rate at which tasks are executed, ensuring they are not run more frequently than a specified interval.

RateLimitingExecutor is ideal for interacting with rate-limited APIs or throttling the execution of resource-intensive tasks.

Sequential Execution

Tasks, ValueTasks, and Actions are executed one at a time. If the defined interval between executions has passed, the task runs immediately; otherwise, it waits until the interval elapses before proceeding.

⚠️ Important Notes:

  • This is not a background queue processor. Each method awaits the result of the asynchronous operation before continuing.

  • Asynchronous methods will not block the calling thread, but synchronous methods will block execution until it completes.

Want to use this with dependency injection?

Check out the singleton factory implementation: Soenneker.Utils.RateLimiting.Factory

Installation

dotnet add package Soenneker.Utils.RateLimiting.Executor

Example: Executing a Loop of Tasks with Rate Limiting

Below is an example demonstrating how to use the RateLimitingExecutor to execute a series of tasks while maintaining a rate limit.

using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Soenneker.Utils.RateLimiting.Executor;

public class Program
{
    public static async Task Main(string[] args)
    {
        var rateLimitingExecutor = new RateLimitingExecutor(TimeSpan.FromSeconds(2));

        for (int i = 0; i < 5; i++)
        {
            await rateLimitingExecutor.Execute(async ct =>
            {
                Console.WriteLine($"Executing Task {i + 1} at {DateTime.Now:HH:mm:ss}");
                await Task.Delay(100); // Simulate some work
            });
        }
    }
}

Console Output

Executing Task 1 at 14:00:00
Executing Task 2 at 14:00:02
Executing Task 3 at 14:00:04
Executing Task 4 at 14:00:06
Executing Task 5 at 14:00:08
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.Utils.RateLimiting.Executor:

Package Downloads
Soenneker.Utils.RateLimiting.Factory

An async thread-safe singleton dictionary for Soenneker.Utils.RateLimiting.Executors, designed to manage the rate at which tasks are executed.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
3.0.428 234 7/9/2025
3.0.427 342 7/4/2025
3.0.426 256 7/3/2025
3.0.425 297 6/28/2025
3.0.424 144 6/27/2025
3.0.423 59 6/27/2025
3.0.422 72 6/27/2025
3.0.421 711 6/11/2025
3.0.420 453 6/3/2025
3.0.419 349 5/27/2025
3.0.418 143 5/27/2025
3.0.417 216 5/27/2025
3.0.416 467 5/23/2025
3.0.415 138 5/23/2025
3.0.414 154 5/22/2025
3.0.413 695 5/8/2025
3.0.412 161 5/7/2025
3.0.411 149 5/7/2025
3.0.410 432 5/5/2025
3.0.409 237 5/5/2025
3.0.408 141 5/5/2025
3.0.407 202 5/5/2025
3.0.406 157 5/5/2025
3.0.405 780 4/8/2025
3.0.404 162 4/8/2025
3.0.403 160 4/8/2025
3.0.402 425 4/8/2025
3.0.401 182 4/8/2025
3.0.400 167 4/8/2025
3.0.399 181 4/8/2025
3.0.398 168 4/8/2025
3.0.397 493 4/7/2025
3.0.396 174 4/7/2025
3.0.395 222 4/7/2025
3.0.394 325 4/7/2025
3.0.393 179 4/7/2025
3.0.392 182 4/7/2025
3.0.391 163 4/6/2025
3.0.390 162 4/6/2025
3.0.389 146 4/6/2025
3.0.388 136 4/6/2025
3.0.387 115 4/6/2025
3.0.386 115 4/6/2025
3.0.385 109 4/6/2025
3.0.384 114 4/6/2025
3.0.383 117 4/5/2025
3.0.382 97 4/5/2025
3.0.381 81 4/5/2025
3.0.380 95 4/5/2025
3.0.379 96 4/5/2025
3.0.378 91 4/5/2025
3.0.377 88 4/5/2025
3.0.376 120 4/4/2025
3.0.375 107 4/4/2025
3.0.374 1,357 4/3/2025
3.0.373 264 4/1/2025
3.0.372 199 4/1/2025
3.0.371 228 4/1/2025
3.0.370 201 3/31/2025
3.0.369 158 3/31/2025
3.0.368 229 3/31/2025
3.0.367 309 3/31/2025
3.0.366 184 3/29/2025
3.0.365 89 3/29/2025
3.0.364 124 3/29/2025
3.0.363 676 3/25/2025
3.0.362 502 3/25/2025
3.0.361 318 3/21/2025
3.0.360 170 3/21/2025
3.0.359 420 3/18/2025
3.0.358 241 3/18/2025
3.0.357 217 3/15/2025
3.0.356 70 3/15/2025
3.0.355 420 3/12/2025
3.0.354 191 3/12/2025
3.0.353 249 3/12/2025
3.0.352 181 3/11/2025
3.0.351 323 3/11/2025
3.0.350 237 3/11/2025
3.0.349 159 3/11/2025
3.0.348 423 3/11/2025
3.0.347 381 3/7/2025
3.0.346 347 3/7/2025
3.0.345 333 3/2/2025
3.0.344 150 3/2/2025
3.0.343 157 3/2/2025
3.0.342 98 3/2/2025
3.0.341 112 3/2/2025
3.0.340 219 3/2/2025
3.0.339 214 3/1/2025
3.0.338 101 3/1/2025
3.0.337 100 3/1/2025
3.0.336 418 3/1/2025
3.0.335 127 3/1/2025
3.0.334 86 3/1/2025
3.0.333 202 3/1/2025
3.0.332 92 3/1/2025
3.0.331 93 3/1/2025
3.0.330 316 2/25/2025
3.0.329 150 2/25/2025
3.0.328 187 2/25/2025
3.0.327 212 2/25/2025
3.0.326 160 2/25/2025
3.0.325 395 2/23/2025
3.0.324 159 2/23/2025
3.0.323 100 2/22/2025
3.0.322 369 2/22/2025
3.0.321 195 2/22/2025
3.0.320 140 2/22/2025
3.0.319 203 2/22/2025
3.0.318 101 2/21/2025
3.0.317 227 2/21/2025
3.0.316 271 2/21/2025
3.0.315 329 2/19/2025
3.0.314 136 2/19/2025
3.0.313 139 2/19/2025
3.0.312 115 2/18/2025
3.0.311 321 2/18/2025
3.0.310 177 2/18/2025
3.0.309 104 2/18/2025
3.0.308 459 2/14/2025
3.0.307 102 2/14/2025
3.0.306 193 2/13/2025
3.0.305 413 2/12/2025
3.0.304 124 2/12/2025
3.0.303 195 2/12/2025
3.0.302 204 2/11/2025
3.0.301 190 2/11/2025
3.0.300 312 2/11/2025
3.0.299 262 2/11/2025
3.0.298 108 2/11/2025
3.0.297 194 2/11/2025
3.0.296 204 2/10/2025
3.0.295 158 2/10/2025
3.0.294 203 2/10/2025
3.0.293 107 2/10/2025
3.0.292 107 2/10/2025
3.0.291 390 2/9/2025
3.0.290 118 2/8/2025
3.0.289 92 2/8/2025
3.0.288 99 2/8/2025
3.0.287 109 2/8/2025
3.0.286 328 2/8/2025
3.0.285 122 2/7/2025
3.0.284 154 2/7/2025
3.0.283 263 2/7/2025
3.0.282 100 2/7/2025
3.0.281 96 2/7/2025
3.0.280 96 2/7/2025
3.0.279 149 2/7/2025
3.0.278 102 2/7/2025
3.0.277 115 2/7/2025
3.0.276 388 2/6/2025
3.0.275 261 2/5/2025
3.0.274 170 2/5/2025
3.0.273 106 2/5/2025
3.0.272 121 2/5/2025
3.0.271 248 2/5/2025
3.0.270 113 2/5/2025
3.0.269 104 2/5/2025
3.0.268 517 1/28/2025
3.0.267 101 1/28/2025
3.0.266 112 1/28/2025
3.0.265 329 1/27/2025
3.0.264 113 1/27/2025
3.0.263 94 1/27/2025
3.0.262 87 1/27/2025
3.0.261 155 1/27/2025
3.0.260 110 1/27/2025
3.0.259 285 1/26/2025
3.0.258 113 1/26/2025
3.0.257 109 1/26/2025
3.0.256 88 1/26/2025
3.0.255 187 1/25/2025
3.0.254 215 1/25/2025
3.0.253 91 1/25/2025
3.0.252 99 1/25/2025
3.0.251 91 1/25/2025
3.0.250 204 1/25/2025
3.0.249 387 1/24/2025
3.0.248 135 1/24/2025
3.0.247 204 1/24/2025
3.0.246 161 1/24/2025
3.0.245 266 1/24/2025
3.0.244 199 1/23/2025
3.0.243 270 1/21/2025
3.0.242 107 1/21/2025
3.0.241 179 1/21/2025
3.0.240 108 1/21/2025
3.0.239 98 1/21/2025
3.0.238 290 1/21/2025
3.0.237 97 1/21/2025
3.0.236 96 1/21/2025
3.0.235 91 1/21/2025
3.0.234 100 1/21/2025
3.0.233 92 1/20/2025
3.0.232 112 1/20/2025
3.0.231 583 1/20/2025
3.0.230 102 1/20/2025
3.0.229 94 1/20/2025
3.0.228 244 1/20/2025
3.0.227 1,830 1/14/2025
3.0.226 77 1/14/2025
3.0.225 83 1/14/2025
3.0.224 150 1/14/2025
3.0.223 196 1/13/2025
3.0.222 182 1/13/2025
3.0.221 134 1/13/2025
3.0.220 89 1/13/2025
3.0.219 82 1/13/2025
3.0.218 231 1/12/2025
3.0.217 171 1/11/2025
3.0.216 144 1/11/2025
3.0.215 147 1/11/2025
3.0.214 105 1/11/2025
3.0.213 140 1/10/2025
3.0.212 104 1/10/2025
3.0.211 87 1/10/2025
3.0.210 96 1/10/2025
3.0.209 245 1/10/2025
3.0.208 105 1/10/2025
3.0.207 105 1/10/2025
3.0.206 648 1/3/2025
3.0.205 130 1/3/2025
3.0.204 170 1/3/2025
3.0.203 128 1/3/2025
3.0.202 208 1/2/2025
3.0.201 105 1/2/2025
3.0.200 103 1/2/2025
3.0.199 191 1/2/2025
3.0.198 105 1/2/2025
3.0.197 101 1/2/2025
3.0.196 414 1/1/2025
3.0.195 189 1/1/2025
3.0.194 116 1/1/2025
3.0.193 134 1/1/2025
3.0.192 219 1/1/2025
3.0.191 107 1/1/2025
3.0.190 111 1/1/2025
3.0.189 120 12/31/2024
3.0.188 108 12/31/2024
3.0.187 108 12/31/2024
3.0.186 112 12/31/2024
3.0.185 113 12/31/2024
3.0.184 167 12/31/2024
3.0.183 122 12/31/2024
3.0.182 403 12/31/2024
3.0.181 99 12/31/2024
3.0.180 264 12/31/2024
3.0.179 170 12/31/2024
3.0.178 105 12/31/2024
3.0.177 111 12/31/2024
3.0.176 108 12/31/2024
3.0.175 96 12/31/2024
3.0.174 128 12/30/2024
3.0.173 361 12/28/2024
3.0.172 124 12/28/2024
3.0.171 165 12/27/2024
3.0.170 101 12/27/2024
3.0.169 432 12/24/2024
3.0.168 208 12/24/2024
3.0.167 130 12/24/2024
3.0.166 108 12/24/2024
3.0.165 191 12/24/2024
3.0.164 96 12/24/2024
3.0.163 194 12/24/2024
3.0.162 89 12/24/2024
3.0.161 140 12/24/2024
3.0.160 110 12/23/2024
3.0.159 165 12/23/2024
3.0.158 183 12/23/2024
3.0.157 111 12/23/2024
3.0.156 278 12/23/2024
3.0.155 119 12/23/2024
3.0.154 266 12/22/2024
3.0.153 104 12/22/2024
3.0.152 107 12/22/2024
3.0.151 213 12/22/2024
3.0.150 110 12/22/2024
3.0.149 105 12/22/2024
3.0.148 100 12/22/2024
3.0.147 281 12/22/2024
3.0.146 105 12/22/2024
3.0.145 116 12/22/2024
3.0.144 113 12/22/2024
3.0.143 270 12/21/2024
3.0.142 107 12/21/2024
3.0.141 114 12/21/2024
3.0.140 102 12/21/2024
3.0.139 113 12/21/2024
3.0.138 101 12/21/2024
3.0.137 101 12/21/2024
3.0.136 109 12/21/2024
3.0.135 290 12/21/2024
3.0.134 192 12/21/2024
3.0.133 99 12/21/2024
3.0.132 103 12/21/2024
3.0.131 98 12/21/2024
3.0.130 248 12/21/2024
3.0.129 102 12/21/2024
3.0.128 164 12/20/2024
3.0.127 102 12/20/2024
3.0.126 187 12/20/2024
3.0.125 107 12/20/2024
3.0.124 211 12/20/2024
3.0.123 185 12/20/2024
3.0.122 116 12/20/2024
3.0.121 179 12/20/2024
3.0.120 202 12/19/2024
3.0.119 189 12/19/2024
3.0.118 110 12/19/2024
3.0.117 157 12/19/2024
3.0.116 101 12/18/2024
3.0.115 151 12/18/2024
3.0.114 216 12/17/2024
3.0.113 121 12/17/2024
3.0.112 90 12/17/2024
3.0.111 226 12/16/2024
3.0.110 312 12/10/2024
3.0.109 113 12/10/2024
3.0.108 182 12/10/2024
3.0.107 107 12/9/2024
3.0.106 183 12/9/2024
3.0.105 227 12/9/2024
3.0.104 105 12/9/2024
3.0.103 303 12/7/2024
3.0.102 127 12/6/2024
3.0.101 123 12/6/2024
3.0.100 122 12/6/2024
3.0.99 128 12/6/2024
3.0.97 154 12/6/2024
3.0.96 130 12/6/2024
3.0.95 114 12/6/2024
3.0.94 114 12/6/2024
3.0.93 110 12/6/2024
3.0.92 108 12/6/2024
3.0.91 147 12/6/2024
3.0.90 132 12/5/2024
3.0.89 137 12/5/2024
3.0.88 686 12/5/2024
3.0.87 154 12/5/2024
3.0.86 153 12/5/2024
3.0.85 200 12/5/2024
3.0.84 136 12/4/2024
3.0.83 156 12/4/2024
3.0.82 213 12/4/2024
3.0.81 211 12/4/2024
3.0.80 182 12/4/2024
3.0.79 110 12/3/2024
3.0.78 207 12/3/2024
3.0.77 200 12/3/2024
3.0.76 168 12/3/2024
3.0.75 103 12/3/2024
3.0.74 151 12/3/2024
3.0.73 102 12/3/2024
3.0.72 376 12/2/2024
3.0.71 162 12/2/2024
3.0.70 178 12/2/2024
3.0.69 105 12/2/2024
3.0.68 183 12/2/2024
3.0.67 233 12/1/2024
3.0.66 112 12/1/2024
3.0.65 264 12/1/2024
3.0.64 144 12/1/2024
3.0.63 218 11/29/2024
3.0.62 186 11/29/2024
3.0.61 266 11/21/2024
3.0.60 127 11/21/2024
3.0.59 270 11/20/2024
3.0.58 110 11/20/2024
3.0.57 134 11/20/2024
3.0.56 114 11/20/2024
3.0.55 111 11/20/2024
3.0.54 128 11/20/2024
3.0.53 118 11/19/2024
3.0.52 109 11/19/2024
3.0.51 105 11/19/2024
3.0.50 392 11/19/2024
3.0.49 102 11/19/2024
3.0.48 322 11/19/2024
3.0.47 103 11/19/2024
3.0.46 109 11/19/2024
3.0.45 311 11/15/2024
3.0.44 154 11/14/2024
3.0.43 111 11/14/2024
3.0.42 104 11/14/2024
3.0.41 151 11/14/2024
3.0.40 122 11/14/2024
3.0.39 231 11/14/2024
3.0.38 328 11/14/2024
3.0.37 174 11/14/2024
3.0.36 114 11/14/2024
3.0.35 106 11/14/2024
3.0.34 156 11/14/2024
3.0.33 119 11/14/2024
3.0.32 204 11/14/2024
2.1.31 309 11/13/2024
2.1.30 195 11/13/2024
2.1.29 273 11/13/2024
2.1.28 160 11/12/2024
2.1.27 102 11/12/2024
2.1.26 659 11/9/2024
2.1.25 198 11/9/2024
2.1.24 361 11/8/2024
2.1.23 121 11/8/2024
2.1.22 113 11/8/2024
2.1.21 305 11/8/2024
2.1.20 248 11/8/2024
2.1.19 277 11/6/2024
2.1.18 352 11/1/2024
2.1.17 115 11/1/2024
2.1.16 344 11/1/2024
2.1.14 123 10/29/2024
2.1.13 268 10/29/2024
2.1.12 164 10/29/2024
2.1.11 431 10/29/2024
2.1.10 273 10/28/2024
2.1.9 106 10/28/2024
2.1.8 145 10/28/2024
2.1.7 365 10/26/2024
2.1.6 128 10/26/2024
2.1.5 274 10/22/2024
2.1.4 127 10/22/2024
2.1.3 111 10/22/2024
2.1.2 116 10/22/2024
2.1.1 133 10/22/2024