Soenneker.Utils.RateLimiting.Executor 3.0.362

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.362
                    
NuGet\Install-Package Soenneker.Utils.RateLimiting.Executor -Version 3.0.362
                    
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.362" />
                    
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.362" />
                    
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.362
                    
#r "nuget: Soenneker.Utils.RateLimiting.Executor, 3.0.362"
                    
#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.362
                    
#: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.362
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.Utils.RateLimiting.Executor&version=3.0.362
                    
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 251 7/9/2025
3.0.427 345 7/4/2025
3.0.426 258 7/3/2025
3.0.425 297 6/28/2025
3.0.424 145 6/27/2025
3.0.423 60 6/27/2025
3.0.422 73 6/27/2025
3.0.421 713 6/11/2025
3.0.420 455 6/3/2025
3.0.419 353 5/27/2025
3.0.418 146 5/27/2025
3.0.417 220 5/27/2025
3.0.416 470 5/23/2025
3.0.415 141 5/23/2025
3.0.414 157 5/22/2025
3.0.413 698 5/8/2025
3.0.412 164 5/7/2025
3.0.411 153 5/7/2025
3.0.410 434 5/5/2025
3.0.409 240 5/5/2025
3.0.408 144 5/5/2025
3.0.407 204 5/5/2025
3.0.406 160 5/5/2025
3.0.405 783 4/8/2025
3.0.404 165 4/8/2025
3.0.403 161 4/8/2025
3.0.402 426 4/8/2025
3.0.401 184 4/8/2025
3.0.400 169 4/8/2025
3.0.399 183 4/8/2025
3.0.398 171 4/8/2025
3.0.397 495 4/7/2025
3.0.396 175 4/7/2025
3.0.395 223 4/7/2025
3.0.394 326 4/7/2025
3.0.393 181 4/7/2025
3.0.392 185 4/7/2025
3.0.391 166 4/6/2025
3.0.390 164 4/6/2025
3.0.389 149 4/6/2025
3.0.388 139 4/6/2025
3.0.387 116 4/6/2025
3.0.386 118 4/6/2025
3.0.385 113 4/6/2025
3.0.384 115 4/6/2025
3.0.383 118 4/5/2025
3.0.382 99 4/5/2025
3.0.381 82 4/5/2025
3.0.380 98 4/5/2025
3.0.379 97 4/5/2025
3.0.378 93 4/5/2025
3.0.377 89 4/5/2025
3.0.376 123 4/4/2025
3.0.375 108 4/4/2025
3.0.374 1,360 4/3/2025
3.0.373 268 4/1/2025
3.0.372 201 4/1/2025
3.0.371 230 4/1/2025
3.0.370 204 3/31/2025
3.0.369 159 3/31/2025
3.0.368 232 3/31/2025
3.0.367 311 3/31/2025
3.0.366 186 3/29/2025
3.0.365 91 3/29/2025
3.0.364 126 3/29/2025
3.0.363 677 3/25/2025
3.0.362 504 3/25/2025
3.0.361 320 3/21/2025
3.0.360 172 3/21/2025
3.0.359 421 3/18/2025
3.0.358 243 3/18/2025
3.0.357 218 3/15/2025
3.0.356 71 3/15/2025
3.0.355 423 3/12/2025
3.0.354 193 3/12/2025
3.0.353 252 3/12/2025
3.0.352 183 3/11/2025
3.0.351 326 3/11/2025
3.0.350 238 3/11/2025
3.0.349 160 3/11/2025
3.0.348 425 3/11/2025
3.0.347 383 3/7/2025
3.0.346 348 3/7/2025
3.0.345 336 3/2/2025
3.0.344 151 3/2/2025
3.0.343 160 3/2/2025
3.0.342 100 3/2/2025
3.0.341 115 3/2/2025
3.0.340 221 3/2/2025
3.0.339 215 3/1/2025
3.0.338 103 3/1/2025
3.0.337 102 3/1/2025
3.0.336 419 3/1/2025
3.0.335 128 3/1/2025
3.0.334 88 3/1/2025
3.0.333 203 3/1/2025
3.0.332 95 3/1/2025
3.0.331 95 3/1/2025
3.0.330 317 2/25/2025
3.0.329 153 2/25/2025
3.0.328 188 2/25/2025
3.0.327 215 2/25/2025
3.0.326 161 2/25/2025
3.0.325 397 2/23/2025
3.0.324 161 2/23/2025
3.0.323 102 2/22/2025
3.0.322 371 2/22/2025
3.0.321 197 2/22/2025
3.0.320 142 2/22/2025
3.0.319 205 2/22/2025
3.0.318 103 2/21/2025
3.0.317 230 2/21/2025
3.0.316 272 2/21/2025
3.0.315 331 2/19/2025
3.0.314 140 2/19/2025
3.0.313 141 2/19/2025
3.0.312 116 2/18/2025
3.0.311 323 2/18/2025
3.0.310 178 2/18/2025
3.0.309 106 2/18/2025
3.0.308 462 2/14/2025
3.0.307 104 2/14/2025
3.0.306 196 2/13/2025
3.0.305 415 2/12/2025
3.0.304 126 2/12/2025
3.0.303 197 2/12/2025
3.0.302 205 2/11/2025
3.0.301 192 2/11/2025
3.0.300 315 2/11/2025
3.0.299 264 2/11/2025
3.0.298 110 2/11/2025
3.0.297 195 2/11/2025
3.0.296 205 2/10/2025
3.0.295 160 2/10/2025
3.0.294 205 2/10/2025
3.0.293 107 2/10/2025
3.0.292 107 2/10/2025
3.0.291 394 2/9/2025
3.0.290 120 2/8/2025
3.0.289 94 2/8/2025
3.0.288 100 2/8/2025
3.0.287 110 2/8/2025
3.0.286 330 2/8/2025
3.0.285 124 2/7/2025
3.0.284 157 2/7/2025
3.0.283 264 2/7/2025
3.0.282 101 2/7/2025
3.0.281 98 2/7/2025
3.0.280 97 2/7/2025
3.0.279 150 2/7/2025
3.0.278 104 2/7/2025
3.0.277 116 2/7/2025
3.0.276 389 2/6/2025
3.0.275 264 2/5/2025
3.0.274 171 2/5/2025
3.0.273 108 2/5/2025
3.0.272 124 2/5/2025
3.0.271 249 2/5/2025
3.0.270 115 2/5/2025
3.0.269 105 2/5/2025
3.0.268 521 1/28/2025
3.0.267 103 1/28/2025
3.0.266 113 1/28/2025
3.0.265 330 1/27/2025
3.0.264 114 1/27/2025
3.0.263 96 1/27/2025
3.0.262 88 1/27/2025
3.0.261 156 1/27/2025
3.0.260 112 1/27/2025
3.0.259 286 1/26/2025
3.0.258 114 1/26/2025
3.0.257 110 1/26/2025
3.0.256 89 1/26/2025
3.0.255 189 1/25/2025
3.0.254 219 1/25/2025
3.0.253 93 1/25/2025
3.0.252 100 1/25/2025
3.0.251 93 1/25/2025
3.0.250 205 1/25/2025
3.0.249 389 1/24/2025
3.0.248 136 1/24/2025
3.0.247 207 1/24/2025
3.0.246 162 1/24/2025
3.0.245 267 1/24/2025
3.0.244 203 1/23/2025
3.0.243 272 1/21/2025
3.0.242 110 1/21/2025
3.0.241 181 1/21/2025
3.0.240 109 1/21/2025
3.0.239 100 1/21/2025
3.0.238 292 1/21/2025
3.0.237 98 1/21/2025
3.0.236 97 1/21/2025
3.0.235 93 1/21/2025
3.0.234 102 1/21/2025
3.0.233 93 1/20/2025
3.0.232 114 1/20/2025
3.0.231 584 1/20/2025
3.0.230 103 1/20/2025
3.0.229 96 1/20/2025
3.0.228 245 1/20/2025
3.0.227 1,831 1/14/2025
3.0.226 79 1/14/2025
3.0.225 84 1/14/2025
3.0.224 151 1/14/2025
3.0.223 199 1/13/2025
3.0.222 183 1/13/2025
3.0.221 137 1/13/2025
3.0.220 92 1/13/2025
3.0.219 84 1/13/2025
3.0.218 232 1/12/2025
3.0.217 172 1/11/2025
3.0.216 148 1/11/2025
3.0.215 149 1/11/2025
3.0.214 108 1/11/2025
3.0.213 141 1/10/2025
3.0.212 107 1/10/2025
3.0.211 89 1/10/2025
3.0.210 100 1/10/2025
3.0.209 247 1/10/2025
3.0.208 106 1/10/2025
3.0.207 107 1/10/2025
3.0.206 649 1/3/2025
3.0.205 132 1/3/2025
3.0.204 171 1/3/2025
3.0.203 132 1/3/2025
3.0.202 209 1/2/2025
3.0.201 107 1/2/2025
3.0.200 108 1/2/2025
3.0.199 192 1/2/2025
3.0.198 107 1/2/2025
3.0.197 102 1/2/2025
3.0.196 417 1/1/2025
3.0.195 190 1/1/2025
3.0.194 117 1/1/2025
3.0.193 135 1/1/2025
3.0.192 220 1/1/2025
3.0.191 113 1/1/2025
3.0.190 114 1/1/2025
3.0.189 123 12/31/2024
3.0.188 110 12/31/2024
3.0.187 109 12/31/2024
3.0.186 114 12/31/2024
3.0.185 114 12/31/2024
3.0.184 168 12/31/2024
3.0.183 124 12/31/2024
3.0.182 404 12/31/2024
3.0.181 101 12/31/2024
3.0.180 266 12/31/2024
3.0.179 172 12/31/2024
3.0.178 109 12/31/2024
3.0.177 113 12/31/2024
3.0.176 110 12/31/2024
3.0.175 98 12/31/2024
3.0.174 129 12/30/2024
3.0.173 363 12/28/2024
3.0.172 125 12/28/2024
3.0.171 166 12/27/2024
3.0.170 102 12/27/2024
3.0.169 433 12/24/2024
3.0.168 210 12/24/2024
3.0.167 131 12/24/2024
3.0.166 109 12/24/2024
3.0.165 192 12/24/2024
3.0.164 97 12/24/2024
3.0.163 197 12/24/2024
3.0.162 90 12/24/2024
3.0.161 141 12/24/2024
3.0.160 112 12/23/2024
3.0.159 166 12/23/2024
3.0.158 184 12/23/2024
3.0.157 113 12/23/2024
3.0.156 279 12/23/2024
3.0.155 120 12/23/2024
3.0.154 269 12/22/2024
3.0.153 105 12/22/2024
3.0.152 109 12/22/2024
3.0.151 214 12/22/2024
3.0.150 112 12/22/2024
3.0.149 106 12/22/2024
3.0.148 101 12/22/2024
3.0.147 283 12/22/2024
3.0.146 106 12/22/2024
3.0.145 118 12/22/2024
3.0.144 115 12/22/2024
3.0.143 273 12/21/2024
3.0.142 108 12/21/2024
3.0.141 115 12/21/2024
3.0.140 103 12/21/2024
3.0.139 114 12/21/2024
3.0.138 104 12/21/2024
3.0.137 102 12/21/2024
3.0.136 111 12/21/2024
3.0.135 291 12/21/2024
3.0.134 195 12/21/2024
3.0.133 100 12/21/2024
3.0.132 106 12/21/2024
3.0.131 99 12/21/2024
3.0.130 249 12/21/2024
3.0.129 105 12/21/2024
3.0.128 166 12/20/2024
3.0.127 106 12/20/2024
3.0.126 188 12/20/2024
3.0.125 108 12/20/2024
3.0.124 213 12/20/2024
3.0.123 186 12/20/2024
3.0.122 118 12/20/2024
3.0.121 183 12/20/2024
3.0.120 204 12/19/2024
3.0.119 191 12/19/2024
3.0.118 111 12/19/2024
3.0.117 158 12/19/2024
3.0.116 102 12/18/2024
3.0.115 152 12/18/2024
3.0.114 218 12/17/2024
3.0.113 123 12/17/2024
3.0.112 91 12/17/2024
3.0.111 228 12/16/2024
3.0.110 314 12/10/2024
3.0.109 116 12/10/2024
3.0.108 183 12/10/2024
3.0.107 108 12/9/2024
3.0.106 185 12/9/2024
3.0.105 231 12/9/2024
3.0.104 107 12/9/2024
3.0.103 306 12/7/2024
3.0.102 130 12/6/2024
3.0.101 125 12/6/2024
3.0.100 123 12/6/2024
3.0.99 132 12/6/2024
3.0.97 157 12/6/2024
3.0.96 133 12/6/2024
3.0.95 117 12/6/2024
3.0.94 117 12/6/2024
3.0.93 112 12/6/2024
3.0.92 110 12/6/2024
3.0.91 150 12/6/2024
3.0.90 133 12/5/2024
3.0.89 138 12/5/2024
3.0.88 687 12/5/2024
3.0.87 156 12/5/2024
3.0.86 155 12/5/2024
3.0.85 203 12/5/2024
3.0.84 139 12/4/2024
3.0.83 158 12/4/2024
3.0.82 214 12/4/2024
3.0.81 212 12/4/2024
3.0.80 183 12/4/2024
3.0.79 111 12/3/2024
3.0.78 210 12/3/2024
3.0.77 201 12/3/2024
3.0.76 171 12/3/2024
3.0.75 104 12/3/2024
3.0.74 152 12/3/2024
3.0.73 103 12/3/2024
3.0.72 377 12/2/2024
3.0.71 164 12/2/2024
3.0.70 179 12/2/2024
3.0.69 106 12/2/2024
3.0.68 185 12/2/2024
3.0.67 234 12/1/2024
3.0.66 115 12/1/2024
3.0.65 266 12/1/2024
3.0.64 146 12/1/2024
3.0.63 219 11/29/2024
3.0.62 188 11/29/2024
3.0.61 267 11/21/2024
3.0.60 128 11/21/2024
3.0.59 271 11/20/2024
3.0.58 111 11/20/2024
3.0.57 136 11/20/2024
3.0.56 115 11/20/2024
3.0.55 112 11/20/2024
3.0.54 130 11/20/2024
3.0.53 119 11/19/2024
3.0.52 110 11/19/2024
3.0.51 106 11/19/2024
3.0.50 393 11/19/2024
3.0.49 104 11/19/2024
3.0.48 324 11/19/2024
3.0.47 104 11/19/2024
3.0.46 110 11/19/2024
3.0.45 312 11/15/2024
3.0.44 155 11/14/2024
3.0.43 112 11/14/2024
3.0.42 106 11/14/2024
3.0.41 153 11/14/2024
3.0.40 123 11/14/2024
3.0.39 232 11/14/2024
3.0.38 329 11/14/2024
3.0.37 175 11/14/2024
3.0.36 116 11/14/2024
3.0.35 107 11/14/2024
3.0.34 159 11/14/2024
3.0.33 120 11/14/2024
3.0.32 206 11/14/2024
2.1.31 313 11/13/2024
2.1.30 197 11/13/2024
2.1.29 274 11/13/2024
2.1.28 163 11/12/2024
2.1.27 103 11/12/2024
2.1.26 660 11/9/2024
2.1.25 201 11/9/2024
2.1.24 362 11/8/2024
2.1.23 123 11/8/2024
2.1.22 114 11/8/2024
2.1.21 306 11/8/2024
2.1.20 249 11/8/2024
2.1.19 279 11/6/2024
2.1.18 353 11/1/2024
2.1.17 116 11/1/2024
2.1.16 350 11/1/2024
2.1.14 124 10/29/2024
2.1.13 269 10/29/2024
2.1.12 165 10/29/2024
2.1.11 433 10/29/2024
2.1.10 275 10/28/2024
2.1.9 107 10/28/2024
2.1.8 146 10/28/2024
2.1.7 366 10/26/2024
2.1.6 130 10/26/2024
2.1.5 275 10/22/2024
2.1.4 128 10/22/2024
2.1.3 112 10/22/2024
2.1.2 117 10/22/2024
2.1.1 134 10/22/2024