Soenneker.Utils.RateLimiting.Executor 3.0.388

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.388
                    
NuGet\Install-Package Soenneker.Utils.RateLimiting.Executor -Version 3.0.388
                    
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.388" />
                    
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.388" />
                    
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.388
                    
#r "nuget: Soenneker.Utils.RateLimiting.Executor, 3.0.388"
                    
#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.Utils.RateLimiting.Executor&version=3.0.388
                    
Install Soenneker.Utils.RateLimiting.Executor as a Cake Addin
#tool nuget:?package=Soenneker.Utils.RateLimiting.Executor&version=3.0.388
                    
Install Soenneker.Utils.RateLimiting.Executor 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.419 140 5/27/2025
3.0.418 83 5/27/2025
3.0.417 138 5/27/2025
3.0.416 438 5/23/2025
3.0.415 121 5/23/2025
3.0.414 130 5/22/2025
3.0.413 679 5/8/2025
3.0.412 144 5/7/2025
3.0.411 135 5/7/2025
3.0.410 417 5/5/2025
3.0.409 223 5/5/2025
3.0.408 130 5/5/2025
3.0.407 185 5/5/2025
3.0.406 138 5/5/2025
3.0.405 768 4/8/2025
3.0.404 149 4/8/2025
3.0.403 150 4/8/2025
3.0.402 412 4/8/2025
3.0.401 168 4/8/2025
3.0.400 152 4/8/2025
3.0.399 163 4/8/2025
3.0.398 150 4/8/2025
3.0.397 474 4/7/2025
3.0.396 160 4/7/2025
3.0.395 213 4/7/2025
3.0.394 316 4/7/2025
3.0.393 164 4/7/2025
3.0.392 162 4/7/2025
3.0.391 149 4/6/2025
3.0.390 152 4/6/2025
3.0.389 131 4/6/2025
3.0.388 122 4/6/2025
3.0.387 105 4/6/2025
3.0.386 99 4/6/2025
3.0.385 96 4/6/2025
3.0.384 101 4/6/2025
3.0.383 103 4/5/2025
3.0.382 80 4/5/2025
3.0.381 72 4/5/2025
3.0.380 80 4/5/2025
3.0.379 80 4/5/2025
3.0.378 78 4/5/2025
3.0.377 78 4/5/2025
3.0.376 97 4/4/2025
3.0.375 92 4/4/2025
3.0.374 1,347 4/3/2025
3.0.373 253 4/1/2025
3.0.372 187 4/1/2025
3.0.371 215 4/1/2025
3.0.370 188 3/31/2025
3.0.369 147 3/31/2025
3.0.368 214 3/31/2025
3.0.367 294 3/31/2025
3.0.366 166 3/29/2025
3.0.365 81 3/29/2025
3.0.364 111 3/29/2025
3.0.363 662 3/25/2025
3.0.362 486 3/25/2025
3.0.361 302 3/21/2025
3.0.360 157 3/21/2025
3.0.359 411 3/18/2025
3.0.358 227 3/18/2025
3.0.357 206 3/15/2025
3.0.356 59 3/15/2025
3.0.355 403 3/12/2025
3.0.354 181 3/12/2025
3.0.353 234 3/12/2025
3.0.352 165 3/11/2025
3.0.351 307 3/11/2025
3.0.350 227 3/11/2025
3.0.349 149 3/11/2025
3.0.348 407 3/11/2025
3.0.347 366 3/7/2025
3.0.346 333 3/7/2025
3.0.345 325 3/2/2025
3.0.344 138 3/2/2025
3.0.343 135 3/2/2025
3.0.342 89 3/2/2025
3.0.341 96 3/2/2025
3.0.340 206 3/2/2025
3.0.339 204 3/1/2025
3.0.338 84 3/1/2025
3.0.337 85 3/1/2025
3.0.336 410 3/1/2025
3.0.335 116 3/1/2025
3.0.334 74 3/1/2025
3.0.333 194 3/1/2025
3.0.332 80 3/1/2025
3.0.331 78 3/1/2025
3.0.330 303 2/25/2025
3.0.329 133 2/25/2025
3.0.328 174 2/25/2025
3.0.327 199 2/25/2025
3.0.326 151 2/25/2025
3.0.325 373 2/23/2025
3.0.324 146 2/23/2025
3.0.323 86 2/22/2025
3.0.322 350 2/22/2025
3.0.321 178 2/22/2025
3.0.320 128 2/22/2025
3.0.319 189 2/22/2025
3.0.318 89 2/21/2025
3.0.317 213 2/21/2025
3.0.316 263 2/21/2025
3.0.315 315 2/19/2025
3.0.314 124 2/19/2025
3.0.313 125 2/19/2025
3.0.312 102 2/18/2025
3.0.311 307 2/18/2025
3.0.310 163 2/18/2025
3.0.309 94 2/18/2025
3.0.308 446 2/14/2025
3.0.307 92 2/14/2025
3.0.306 170 2/13/2025
3.0.305 397 2/12/2025
3.0.304 113 2/12/2025
3.0.303 184 2/12/2025
3.0.302 186 2/11/2025
3.0.301 175 2/11/2025
3.0.300 303 2/11/2025
3.0.299 241 2/11/2025
3.0.298 92 2/11/2025
3.0.297 177 2/11/2025
3.0.296 194 2/10/2025
3.0.295 144 2/10/2025
3.0.294 191 2/10/2025
3.0.293 93 2/10/2025
3.0.292 97 2/10/2025
3.0.291 380 2/9/2025
3.0.290 107 2/8/2025
3.0.289 82 2/8/2025
3.0.288 86 2/8/2025
3.0.287 94 2/8/2025
3.0.286 312 2/8/2025
3.0.285 107 2/7/2025
3.0.284 139 2/7/2025
3.0.283 256 2/7/2025
3.0.282 92 2/7/2025
3.0.281 86 2/7/2025
3.0.280 86 2/7/2025
3.0.279 135 2/7/2025
3.0.278 85 2/7/2025
3.0.277 99 2/7/2025
3.0.276 377 2/6/2025
3.0.275 250 2/5/2025
3.0.274 162 2/5/2025
3.0.273 93 2/5/2025
3.0.272 104 2/5/2025
3.0.271 239 2/5/2025
3.0.270 100 2/5/2025
3.0.269 93 2/5/2025
3.0.268 503 1/28/2025
3.0.267 88 1/28/2025
3.0.266 102 1/28/2025
3.0.265 318 1/27/2025
3.0.264 96 1/27/2025
3.0.263 79 1/27/2025
3.0.262 75 1/27/2025
3.0.261 143 1/27/2025
3.0.260 100 1/27/2025
3.0.259 275 1/26/2025
3.0.258 102 1/26/2025
3.0.257 95 1/26/2025
3.0.256 78 1/26/2025
3.0.255 170 1/25/2025
3.0.254 204 1/25/2025
3.0.253 83 1/25/2025
3.0.252 81 1/25/2025
3.0.251 79 1/25/2025
3.0.250 196 1/25/2025
3.0.249 371 1/24/2025
3.0.248 123 1/24/2025
3.0.247 189 1/24/2025
3.0.246 148 1/24/2025
3.0.245 252 1/24/2025
3.0.244 184 1/23/2025
3.0.243 256 1/21/2025
3.0.242 92 1/21/2025
3.0.241 168 1/21/2025
3.0.240 95 1/21/2025
3.0.239 81 1/21/2025
3.0.238 277 1/21/2025
3.0.237 88 1/21/2025
3.0.236 83 1/21/2025
3.0.235 80 1/21/2025
3.0.234 84 1/21/2025
3.0.233 82 1/20/2025
3.0.232 98 1/20/2025
3.0.231 568 1/20/2025
3.0.230 92 1/20/2025
3.0.229 81 1/20/2025
3.0.228 237 1/20/2025
3.0.227 1,820 1/14/2025
3.0.226 62 1/14/2025
3.0.225 77 1/14/2025
3.0.224 137 1/14/2025
3.0.223 184 1/13/2025
3.0.222 172 1/13/2025
3.0.221 124 1/13/2025
3.0.220 75 1/13/2025
3.0.219 67 1/13/2025
3.0.218 214 1/12/2025
3.0.217 154 1/11/2025
3.0.216 127 1/11/2025
3.0.215 132 1/11/2025
3.0.214 88 1/11/2025
3.0.213 129 1/10/2025
3.0.212 89 1/10/2025
3.0.211 81 1/10/2025
3.0.210 83 1/10/2025
3.0.209 235 1/10/2025
3.0.208 91 1/10/2025
3.0.207 89 1/10/2025
3.0.206 634 1/3/2025
3.0.205 116 1/3/2025
3.0.204 163 1/3/2025
3.0.203 112 1/3/2025
3.0.202 190 1/2/2025
3.0.201 93 1/2/2025
3.0.200 91 1/2/2025
3.0.199 174 1/2/2025
3.0.198 88 1/2/2025
3.0.197 92 1/2/2025
3.0.196 395 1/1/2025
3.0.195 173 1/1/2025
3.0.194 103 1/1/2025
3.0.193 121 1/1/2025
3.0.192 206 1/1/2025
3.0.191 96 1/1/2025
3.0.190 101 1/1/2025
3.0.189 107 12/31/2024
3.0.188 95 12/31/2024
3.0.187 99 12/31/2024
3.0.186 100 12/31/2024
3.0.185 92 12/31/2024
3.0.184 153 12/31/2024
3.0.183 106 12/31/2024
3.0.182 390 12/31/2024
3.0.181 89 12/31/2024
3.0.180 250 12/31/2024
3.0.179 149 12/31/2024
3.0.178 94 12/31/2024
3.0.177 97 12/31/2024
3.0.176 95 12/31/2024
3.0.175 87 12/31/2024
3.0.174 118 12/30/2024
3.0.173 351 12/28/2024
3.0.172 111 12/28/2024
3.0.171 151 12/27/2024
3.0.170 94 12/27/2024
3.0.169 421 12/24/2024
3.0.168 190 12/24/2024
3.0.167 121 12/24/2024
3.0.166 100 12/24/2024
3.0.165 184 12/24/2024
3.0.164 89 12/24/2024
3.0.163 178 12/24/2024
3.0.162 82 12/24/2024
3.0.161 125 12/24/2024
3.0.160 100 12/23/2024
3.0.159 159 12/23/2024
3.0.158 172 12/23/2024
3.0.157 96 12/23/2024
3.0.156 267 12/23/2024
3.0.155 112 12/23/2024
3.0.154 253 12/22/2024
3.0.153 95 12/22/2024
3.0.152 92 12/22/2024
3.0.151 204 12/22/2024
3.0.150 99 12/22/2024
3.0.149 94 12/22/2024
3.0.148 88 12/22/2024
3.0.147 273 12/22/2024
3.0.146 96 12/22/2024
3.0.145 105 12/22/2024
3.0.144 95 12/22/2024
3.0.143 259 12/21/2024
3.0.142 93 12/21/2024
3.0.141 105 12/21/2024
3.0.140 90 12/21/2024
3.0.139 94 12/21/2024
3.0.138 87 12/21/2024
3.0.137 90 12/21/2024
3.0.136 96 12/21/2024
3.0.135 282 12/21/2024
3.0.134 177 12/21/2024
3.0.133 90 12/21/2024
3.0.132 93 12/21/2024
3.0.131 83 12/21/2024
3.0.130 240 12/21/2024
3.0.129 91 12/21/2024
3.0.128 144 12/20/2024
3.0.127 86 12/20/2024
3.0.126 167 12/20/2024
3.0.125 90 12/20/2024
3.0.124 190 12/20/2024
3.0.123 168 12/20/2024
3.0.122 94 12/20/2024
3.0.121 167 12/20/2024
3.0.120 192 12/19/2024
3.0.119 168 12/19/2024
3.0.118 101 12/19/2024
3.0.117 147 12/19/2024
3.0.116 94 12/18/2024
3.0.115 142 12/18/2024
3.0.114 198 12/17/2024
3.0.113 110 12/17/2024
3.0.112 73 12/17/2024
3.0.111 211 12/16/2024
3.0.110 291 12/10/2024
3.0.109 96 12/10/2024
3.0.108 175 12/10/2024
3.0.107 94 12/9/2024
3.0.106 177 12/9/2024
3.0.105 216 12/9/2024
3.0.104 92 12/9/2024
3.0.103 293 12/7/2024
3.0.102 116 12/6/2024
3.0.101 115 12/6/2024
3.0.100 109 12/6/2024
3.0.99 112 12/6/2024
3.0.97 138 12/6/2024
3.0.96 118 12/6/2024
3.0.95 96 12/6/2024
3.0.94 99 12/6/2024
3.0.93 99 12/6/2024
3.0.92 99 12/6/2024
3.0.91 134 12/6/2024
3.0.90 125 12/5/2024
3.0.89 122 12/5/2024
3.0.88 676 12/5/2024
3.0.87 137 12/5/2024
3.0.86 142 12/5/2024
3.0.85 188 12/5/2024
3.0.84 121 12/4/2024
3.0.83 143 12/4/2024
3.0.82 201 12/4/2024
3.0.81 188 12/4/2024
3.0.80 170 12/4/2024
3.0.79 98 12/3/2024
3.0.78 193 12/3/2024
3.0.77 193 12/3/2024
3.0.76 155 12/3/2024
3.0.75 87 12/3/2024
3.0.74 141 12/3/2024
3.0.73 86 12/3/2024
3.0.72 363 12/2/2024
3.0.71 151 12/2/2024
3.0.70 168 12/2/2024
3.0.69 95 12/2/2024
3.0.68 169 12/2/2024
3.0.67 216 12/1/2024
3.0.66 97 12/1/2024
3.0.65 252 12/1/2024
3.0.64 130 12/1/2024
3.0.63 202 11/29/2024
3.0.62 172 11/29/2024
3.0.61 259 11/21/2024
3.0.60 111 11/21/2024
3.0.59 260 11/20/2024
3.0.58 102 11/20/2024
3.0.57 123 11/20/2024
3.0.56 101 11/20/2024
3.0.55 102 11/20/2024
3.0.54 114 11/20/2024
3.0.53 109 11/19/2024
3.0.52 101 11/19/2024
3.0.51 97 11/19/2024
3.0.50 384 11/19/2024
3.0.49 89 11/19/2024
3.0.48 309 11/19/2024
3.0.47 95 11/19/2024
3.0.46 99 11/19/2024
3.0.45 296 11/15/2024
3.0.44 142 11/14/2024
3.0.43 96 11/14/2024
3.0.42 95 11/14/2024
3.0.41 141 11/14/2024
3.0.40 109 11/14/2024
3.0.39 220 11/14/2024
3.0.38 317 11/14/2024
3.0.37 163 11/14/2024
3.0.36 97 11/14/2024
3.0.35 99 11/14/2024
3.0.34 144 11/14/2024
3.0.33 101 11/14/2024
3.0.32 195 11/14/2024
2.1.31 297 11/13/2024
2.1.30 184 11/13/2024
2.1.29 261 11/13/2024
2.1.28 147 11/12/2024
2.1.27 91 11/12/2024
2.1.26 653 11/9/2024
2.1.25 183 11/9/2024
2.1.24 344 11/8/2024
2.1.23 108 11/8/2024
2.1.22 99 11/8/2024
2.1.21 292 11/8/2024
2.1.20 237 11/8/2024
2.1.19 265 11/6/2024
2.1.18 337 11/1/2024
2.1.17 98 11/1/2024
2.1.16 326 11/1/2024
2.1.14 113 10/29/2024
2.1.13 261 10/29/2024
2.1.12 148 10/29/2024
2.1.11 417 10/29/2024
2.1.10 260 10/28/2024
2.1.9 98 10/28/2024
2.1.8 127 10/28/2024
2.1.7 359 10/26/2024
2.1.6 117 10/26/2024
2.1.5 263 10/22/2024
2.1.4 119 10/22/2024
2.1.3 95 10/22/2024
2.1.2 104 10/22/2024
2.1.1 124 10/22/2024