Soenneker.Utils.RateLimiting.Executor 3.0.418

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.418
                    
NuGet\Install-Package Soenneker.Utils.RateLimiting.Executor -Version 3.0.418
                    
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.418" />
                    
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.418" />
                    
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.418
                    
#r "nuget: Soenneker.Utils.RateLimiting.Executor, 3.0.418"
                    
#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.418
                    
Install Soenneker.Utils.RateLimiting.Executor as a Cake Addin
#tool nuget:?package=Soenneker.Utils.RateLimiting.Executor&version=3.0.418
                    
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.421 481 6/11/2025
3.0.420 443 6/3/2025
3.0.419 339 5/27/2025
3.0.418 134 5/27/2025
3.0.417 209 5/27/2025
3.0.416 457 5/23/2025
3.0.415 129 5/23/2025
3.0.414 142 5/22/2025
3.0.413 687 5/8/2025
3.0.412 153 5/7/2025
3.0.411 140 5/7/2025
3.0.410 423 5/5/2025
3.0.409 230 5/5/2025
3.0.408 135 5/5/2025
3.0.407 190 5/5/2025
3.0.406 145 5/5/2025
3.0.405 773 4/8/2025
3.0.404 152 4/8/2025
3.0.403 154 4/8/2025
3.0.402 417 4/8/2025
3.0.401 171 4/8/2025
3.0.400 155 4/8/2025
3.0.399 169 4/8/2025
3.0.398 157 4/8/2025
3.0.397 483 4/7/2025
3.0.396 167 4/7/2025
3.0.395 217 4/7/2025
3.0.394 319 4/7/2025
3.0.393 169 4/7/2025
3.0.392 171 4/7/2025
3.0.391 153 4/6/2025
3.0.390 155 4/6/2025
3.0.389 139 4/6/2025
3.0.388 126 4/6/2025
3.0.387 108 4/6/2025
3.0.386 106 4/6/2025
3.0.385 101 4/6/2025
3.0.384 107 4/6/2025
3.0.383 110 4/5/2025
3.0.382 87 4/5/2025
3.0.381 75 4/5/2025
3.0.380 84 4/5/2025
3.0.379 88 4/5/2025
3.0.378 81 4/5/2025
3.0.377 81 4/5/2025
3.0.376 108 4/4/2025
3.0.375 97 4/4/2025
3.0.374 1,350 4/3/2025
3.0.373 256 4/1/2025
3.0.372 190 4/1/2025
3.0.371 218 4/1/2025
3.0.370 192 3/31/2025
3.0.369 150 3/31/2025
3.0.368 217 3/31/2025
3.0.367 297 3/31/2025
3.0.366 171 3/29/2025
3.0.365 83 3/29/2025
3.0.364 117 3/29/2025
3.0.363 665 3/25/2025
3.0.362 489 3/25/2025
3.0.361 307 3/21/2025
3.0.360 162 3/21/2025
3.0.359 413 3/18/2025
3.0.358 232 3/18/2025
3.0.357 208 3/15/2025
3.0.356 63 3/15/2025
3.0.355 408 3/12/2025
3.0.354 183 3/12/2025
3.0.353 239 3/12/2025
3.0.352 171 3/11/2025
3.0.351 312 3/11/2025
3.0.350 229 3/11/2025
3.0.349 153 3/11/2025
3.0.348 411 3/11/2025
3.0.347 370 3/7/2025
3.0.346 335 3/7/2025
3.0.345 328 3/2/2025
3.0.344 140 3/2/2025
3.0.343 142 3/2/2025
3.0.342 91 3/2/2025
3.0.341 98 3/2/2025
3.0.340 211 3/2/2025
3.0.339 207 3/1/2025
3.0.338 90 3/1/2025
3.0.337 87 3/1/2025
3.0.336 412 3/1/2025
3.0.335 119 3/1/2025
3.0.334 79 3/1/2025
3.0.333 196 3/1/2025
3.0.332 82 3/1/2025
3.0.331 83 3/1/2025
3.0.330 306 2/25/2025
3.0.329 137 2/25/2025
3.0.328 178 2/25/2025
3.0.327 204 2/25/2025
3.0.326 154 2/25/2025
3.0.325 381 2/23/2025
3.0.324 149 2/23/2025
3.0.323 93 2/22/2025
3.0.322 357 2/22/2025
3.0.321 183 2/22/2025
3.0.320 131 2/22/2025
3.0.319 194 2/22/2025
3.0.318 92 2/21/2025
3.0.317 219 2/21/2025
3.0.316 265 2/21/2025
3.0.315 317 2/19/2025
3.0.314 127 2/19/2025
3.0.313 129 2/19/2025
3.0.312 105 2/18/2025
3.0.311 312 2/18/2025
3.0.310 165 2/18/2025
3.0.309 96 2/18/2025
3.0.308 449 2/14/2025
3.0.307 95 2/14/2025
3.0.306 181 2/13/2025
3.0.305 403 2/12/2025
3.0.304 115 2/12/2025
3.0.303 186 2/12/2025
3.0.302 191 2/11/2025
3.0.301 177 2/11/2025
3.0.300 307 2/11/2025
3.0.299 249 2/11/2025
3.0.298 97 2/11/2025
3.0.297 184 2/11/2025
3.0.296 197 2/10/2025
3.0.295 148 2/10/2025
3.0.294 197 2/10/2025
3.0.293 97 2/10/2025
3.0.292 99 2/10/2025
3.0.291 382 2/9/2025
3.0.290 109 2/8/2025
3.0.289 84 2/8/2025
3.0.288 91 2/8/2025
3.0.287 99 2/8/2025
3.0.286 316 2/8/2025
3.0.285 109 2/7/2025
3.0.284 142 2/7/2025
3.0.283 258 2/7/2025
3.0.282 94 2/7/2025
3.0.281 88 2/7/2025
3.0.280 88 2/7/2025
3.0.279 139 2/7/2025
3.0.278 92 2/7/2025
3.0.277 107 2/7/2025
3.0.276 380 2/6/2025
3.0.275 255 2/5/2025
3.0.274 165 2/5/2025
3.0.273 96 2/5/2025
3.0.272 109 2/5/2025
3.0.271 242 2/5/2025
3.0.270 105 2/5/2025
3.0.269 98 2/5/2025
3.0.268 507 1/28/2025
3.0.267 95 1/28/2025
3.0.266 106 1/28/2025
3.0.265 322 1/27/2025
3.0.264 103 1/27/2025
3.0.263 81 1/27/2025
3.0.262 79 1/27/2025
3.0.261 146 1/27/2025
3.0.260 102 1/27/2025
3.0.259 279 1/26/2025
3.0.258 108 1/26/2025
3.0.257 97 1/26/2025
3.0.256 83 1/26/2025
3.0.255 174 1/25/2025
3.0.254 206 1/25/2025
3.0.253 85 1/25/2025
3.0.252 87 1/25/2025
3.0.251 81 1/25/2025
3.0.250 199 1/25/2025
3.0.249 375 1/24/2025
3.0.248 125 1/24/2025
3.0.247 195 1/24/2025
3.0.246 152 1/24/2025
3.0.245 254 1/24/2025
3.0.244 191 1/23/2025
3.0.243 258 1/21/2025
3.0.242 94 1/21/2025
3.0.241 170 1/21/2025
3.0.240 98 1/21/2025
3.0.239 88 1/21/2025
3.0.238 282 1/21/2025
3.0.237 90 1/21/2025
3.0.236 87 1/21/2025
3.0.235 84 1/21/2025
3.0.234 87 1/21/2025
3.0.233 86 1/20/2025
3.0.232 102 1/20/2025
3.0.231 574 1/20/2025
3.0.230 95 1/20/2025
3.0.229 84 1/20/2025
3.0.228 239 1/20/2025
3.0.227 1,824 1/14/2025
3.0.226 65 1/14/2025
3.0.225 79 1/14/2025
3.0.224 143 1/14/2025
3.0.223 186 1/13/2025
3.0.222 176 1/13/2025
3.0.221 127 1/13/2025
3.0.220 80 1/13/2025
3.0.219 75 1/13/2025
3.0.218 222 1/12/2025
3.0.217 162 1/11/2025
3.0.216 135 1/11/2025
3.0.215 136 1/11/2025
3.0.214 95 1/11/2025
3.0.213 133 1/10/2025
3.0.212 95 1/10/2025
3.0.211 83 1/10/2025
3.0.210 86 1/10/2025
3.0.209 237 1/10/2025
3.0.208 96 1/10/2025
3.0.207 91 1/10/2025
3.0.206 638 1/3/2025
3.0.205 122 1/3/2025
3.0.204 165 1/3/2025
3.0.203 117 1/3/2025
3.0.202 198 1/2/2025
3.0.201 95 1/2/2025
3.0.200 94 1/2/2025
3.0.199 178 1/2/2025
3.0.198 94 1/2/2025
3.0.197 94 1/2/2025
3.0.196 401 1/1/2025
3.0.195 177 1/1/2025
3.0.194 107 1/1/2025
3.0.193 124 1/1/2025
3.0.192 209 1/1/2025
3.0.191 100 1/1/2025
3.0.190 104 1/1/2025
3.0.189 109 12/31/2024
3.0.188 100 12/31/2024
3.0.187 103 12/31/2024
3.0.186 104 12/31/2024
3.0.185 101 12/31/2024
3.0.184 155 12/31/2024
3.0.183 110 12/31/2024
3.0.182 393 12/31/2024
3.0.181 91 12/31/2024
3.0.180 256 12/31/2024
3.0.179 158 12/31/2024
3.0.178 99 12/31/2024
3.0.177 105 12/31/2024
3.0.176 100 12/31/2024
3.0.175 89 12/31/2024
3.0.174 122 12/30/2024
3.0.173 355 12/28/2024
3.0.172 118 12/28/2024
3.0.171 154 12/27/2024
3.0.170 97 12/27/2024
3.0.169 424 12/24/2024
3.0.168 195 12/24/2024
3.0.167 123 12/24/2024
3.0.166 102 12/24/2024
3.0.165 187 12/24/2024
3.0.164 91 12/24/2024
3.0.163 186 12/24/2024
3.0.162 84 12/24/2024
3.0.161 131 12/24/2024
3.0.160 102 12/23/2024
3.0.159 161 12/23/2024
3.0.158 174 12/23/2024
3.0.157 102 12/23/2024
3.0.156 270 12/23/2024
3.0.155 114 12/23/2024
3.0.154 257 12/22/2024
3.0.153 98 12/22/2024
3.0.152 100 12/22/2024
3.0.151 206 12/22/2024
3.0.150 101 12/22/2024
3.0.149 96 12/22/2024
3.0.148 91 12/22/2024
3.0.147 276 12/22/2024
3.0.146 98 12/22/2024
3.0.145 108 12/22/2024
3.0.144 101 12/22/2024
3.0.143 261 12/21/2024
3.0.142 98 12/21/2024
3.0.141 108 12/21/2024
3.0.140 93 12/21/2024
3.0.139 102 12/21/2024
3.0.138 90 12/21/2024
3.0.137 95 12/21/2024
3.0.136 101 12/21/2024
3.0.135 285 12/21/2024
3.0.134 181 12/21/2024
3.0.133 93 12/21/2024
3.0.132 97 12/21/2024
3.0.131 85 12/21/2024
3.0.130 242 12/21/2024
3.0.129 93 12/21/2024
3.0.128 152 12/20/2024
3.0.127 91 12/20/2024
3.0.126 176 12/20/2024
3.0.125 97 12/20/2024
3.0.124 202 12/20/2024
3.0.123 176 12/20/2024
3.0.122 105 12/20/2024
3.0.121 171 12/20/2024
3.0.120 194 12/19/2024
3.0.119 179 12/19/2024
3.0.118 104 12/19/2024
3.0.117 149 12/19/2024
3.0.116 97 12/18/2024
3.0.115 144 12/18/2024
3.0.114 202 12/17/2024
3.0.113 112 12/17/2024
3.0.112 78 12/17/2024
3.0.111 218 12/16/2024
3.0.110 302 12/10/2024
3.0.109 102 12/10/2024
3.0.108 178 12/10/2024
3.0.107 97 12/9/2024
3.0.106 179 12/9/2024
3.0.105 219 12/9/2024
3.0.104 96 12/9/2024
3.0.103 295 12/7/2024
3.0.102 118 12/6/2024
3.0.101 118 12/6/2024
3.0.100 111 12/6/2024
3.0.99 118 12/6/2024
3.0.97 145 12/6/2024
3.0.96 120 12/6/2024
3.0.95 104 12/6/2024
3.0.94 107 12/6/2024
3.0.93 104 12/6/2024
3.0.92 101 12/6/2024
3.0.91 136 12/6/2024
3.0.90 127 12/5/2024
3.0.89 128 12/5/2024
3.0.88 679 12/5/2024
3.0.87 144 12/5/2024
3.0.86 145 12/5/2024
3.0.85 190 12/5/2024
3.0.84 125 12/4/2024
3.0.83 146 12/4/2024
3.0.82 206 12/4/2024
3.0.81 196 12/4/2024
3.0.80 174 12/4/2024
3.0.79 103 12/3/2024
3.0.78 198 12/3/2024
3.0.77 196 12/3/2024
3.0.76 161 12/3/2024
3.0.75 93 12/3/2024
3.0.74 145 12/3/2024
3.0.73 91 12/3/2024
3.0.72 368 12/2/2024
3.0.71 153 12/2/2024
3.0.70 172 12/2/2024
3.0.69 98 12/2/2024
3.0.68 176 12/2/2024
3.0.67 221 12/1/2024
3.0.66 105 12/1/2024
3.0.65 256 12/1/2024
3.0.64 133 12/1/2024
3.0.63 206 11/29/2024
3.0.62 177 11/29/2024
3.0.61 262 11/21/2024
3.0.60 118 11/21/2024
3.0.59 262 11/20/2024
3.0.58 105 11/20/2024
3.0.57 125 11/20/2024
3.0.56 106 11/20/2024
3.0.55 105 11/20/2024
3.0.54 119 11/20/2024
3.0.53 113 11/19/2024
3.0.52 103 11/19/2024
3.0.51 99 11/19/2024
3.0.50 387 11/19/2024
3.0.49 92 11/19/2024
3.0.48 314 11/19/2024
3.0.47 98 11/19/2024
3.0.46 102 11/19/2024
3.0.45 298 11/15/2024
3.0.44 147 11/14/2024
3.0.43 103 11/14/2024
3.0.42 97 11/14/2024
3.0.41 143 11/14/2024
3.0.40 111 11/14/2024
3.0.39 222 11/14/2024
3.0.38 321 11/14/2024
3.0.37 165 11/14/2024
3.0.36 101 11/14/2024
3.0.35 102 11/14/2024
3.0.34 147 11/14/2024
3.0.33 107 11/14/2024
3.0.32 197 11/14/2024
2.1.31 301 11/13/2024
2.1.30 188 11/13/2024
2.1.29 264 11/13/2024
2.1.28 150 11/12/2024
2.1.27 96 11/12/2024
2.1.26 655 11/9/2024
2.1.25 187 11/9/2024
2.1.24 348 11/8/2024
2.1.23 112 11/8/2024
2.1.22 105 11/8/2024
2.1.21 296 11/8/2024
2.1.20 242 11/8/2024
2.1.19 268 11/6/2024
2.1.18 344 11/1/2024
2.1.17 104 11/1/2024
2.1.16 331 11/1/2024
2.1.14 118 10/29/2024
2.1.13 263 10/29/2024
2.1.12 150 10/29/2024
2.1.11 424 10/29/2024
2.1.10 265 10/28/2024
2.1.9 101 10/28/2024
2.1.8 130 10/28/2024
2.1.7 361 10/26/2024
2.1.6 120 10/26/2024
2.1.5 266 10/22/2024
2.1.4 122 10/22/2024
2.1.3 99 10/22/2024
2.1.2 109 10/22/2024
2.1.1 126 10/22/2024