Soenneker.Utils.RateLimiting.Executor 3.0.390

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.390
                    
NuGet\Install-Package Soenneker.Utils.RateLimiting.Executor -Version 3.0.390
                    
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.390" />
                    
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.390" />
                    
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.390
                    
#r "nuget: Soenneker.Utils.RateLimiting.Executor, 3.0.390"
                    
#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.390
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.Utils.RateLimiting.Executor&version=3.0.390
                    
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.425 8 6/28/2025
3.0.424 24 6/27/2025
3.0.423 18 6/27/2025
3.0.422 25 6/27/2025
3.0.421 578 6/11/2025
3.0.420 449 6/3/2025
3.0.419 345 5/27/2025
3.0.418 138 5/27/2025
3.0.417 212 5/27/2025
3.0.416 463 5/23/2025
3.0.415 132 5/23/2025
3.0.414 150 5/22/2025
3.0.413 690 5/8/2025
3.0.412 157 5/7/2025
3.0.411 144 5/7/2025
3.0.410 430 5/5/2025
3.0.409 235 5/5/2025
3.0.408 138 5/5/2025
3.0.407 196 5/5/2025
3.0.406 153 5/5/2025
3.0.405 776 4/8/2025
3.0.404 157 4/8/2025
3.0.403 158 4/8/2025
3.0.402 422 4/8/2025
3.0.401 173 4/8/2025
3.0.400 159 4/8/2025
3.0.399 175 4/8/2025
3.0.398 162 4/8/2025
3.0.397 487 4/7/2025
3.0.396 170 4/7/2025
3.0.395 220 4/7/2025
3.0.394 322 4/7/2025
3.0.393 174 4/7/2025
3.0.392 176 4/7/2025
3.0.391 157 4/6/2025
3.0.390 158 4/6/2025
3.0.389 142 4/6/2025
3.0.388 131 4/6/2025
3.0.387 111 4/6/2025
3.0.386 112 4/6/2025
3.0.385 105 4/6/2025
3.0.384 112 4/6/2025
3.0.383 114 4/5/2025
3.0.382 92 4/5/2025
3.0.381 78 4/5/2025
3.0.380 91 4/5/2025
3.0.379 93 4/5/2025
3.0.378 85 4/5/2025
3.0.377 85 4/5/2025
3.0.376 113 4/4/2025
3.0.375 103 4/4/2025
3.0.374 1,354 4/3/2025
3.0.373 259 4/1/2025
3.0.372 193 4/1/2025
3.0.371 221 4/1/2025
3.0.370 195 3/31/2025
3.0.369 155 3/31/2025
3.0.368 221 3/31/2025
3.0.367 300 3/31/2025
3.0.366 176 3/29/2025
3.0.365 86 3/29/2025
3.0.364 120 3/29/2025
3.0.363 669 3/25/2025
3.0.362 492 3/25/2025
3.0.361 313 3/21/2025
3.0.360 167 3/21/2025
3.0.359 417 3/18/2025
3.0.358 236 3/18/2025
3.0.357 211 3/15/2025
3.0.356 67 3/15/2025
3.0.355 414 3/12/2025
3.0.354 186 3/12/2025
3.0.353 243 3/12/2025
3.0.352 175 3/11/2025
3.0.351 318 3/11/2025
3.0.350 234 3/11/2025
3.0.349 157 3/11/2025
3.0.348 420 3/11/2025
3.0.347 373 3/7/2025
3.0.346 340 3/7/2025
3.0.345 331 3/2/2025
3.0.344 143 3/2/2025
3.0.343 150 3/2/2025
3.0.342 94 3/2/2025
3.0.341 103 3/2/2025
3.0.340 214 3/2/2025
3.0.339 211 3/1/2025
3.0.338 94 3/1/2025
3.0.337 92 3/1/2025
3.0.336 415 3/1/2025
3.0.335 122 3/1/2025
3.0.334 82 3/1/2025
3.0.333 199 3/1/2025
3.0.332 86 3/1/2025
3.0.331 87 3/1/2025
3.0.330 309 2/25/2025
3.0.329 144 2/25/2025
3.0.328 181 2/25/2025
3.0.327 207 2/25/2025
3.0.326 157 2/25/2025
3.0.325 387 2/23/2025
3.0.324 155 2/23/2025
3.0.323 96 2/22/2025
3.0.322 361 2/22/2025
3.0.321 187 2/22/2025
3.0.320 134 2/22/2025
3.0.319 198 2/22/2025
3.0.318 96 2/21/2025
3.0.317 222 2/21/2025
3.0.316 268 2/21/2025
3.0.315 320 2/19/2025
3.0.314 130 2/19/2025
3.0.313 132 2/19/2025
3.0.312 110 2/18/2025
3.0.311 315 2/18/2025
3.0.310 170 2/18/2025
3.0.309 102 2/18/2025
3.0.308 454 2/14/2025
3.0.307 98 2/14/2025
3.0.306 186 2/13/2025
3.0.305 407 2/12/2025
3.0.304 118 2/12/2025
3.0.303 189 2/12/2025
3.0.302 196 2/11/2025
3.0.301 181 2/11/2025
3.0.300 310 2/11/2025
3.0.299 256 2/11/2025
3.0.298 103 2/11/2025
3.0.297 190 2/11/2025
3.0.296 201 2/10/2025
3.0.295 151 2/10/2025
3.0.294 200 2/10/2025
3.0.293 101 2/10/2025
3.0.292 102 2/10/2025
3.0.291 385 2/9/2025
3.0.290 112 2/8/2025
3.0.289 88 2/8/2025
3.0.288 94 2/8/2025
3.0.287 104 2/8/2025
3.0.286 323 2/8/2025
3.0.285 113 2/7/2025
3.0.284 147 2/7/2025
3.0.283 261 2/7/2025
3.0.282 97 2/7/2025
3.0.281 91 2/7/2025
3.0.280 92 2/7/2025
3.0.279 143 2/7/2025
3.0.278 96 2/7/2025
3.0.277 111 2/7/2025
3.0.276 384 2/6/2025
3.0.275 257 2/5/2025
3.0.274 167 2/5/2025
3.0.273 99 2/5/2025
3.0.272 113 2/5/2025
3.0.271 245 2/5/2025
3.0.270 107 2/5/2025
3.0.269 101 2/5/2025
3.0.268 511 1/28/2025
3.0.267 97 1/28/2025
3.0.266 110 1/28/2025
3.0.265 325 1/27/2025
3.0.264 107 1/27/2025
3.0.263 86 1/27/2025
3.0.262 81 1/27/2025
3.0.261 149 1/27/2025
3.0.260 104 1/27/2025
3.0.259 283 1/26/2025
3.0.258 110 1/26/2025
3.0.257 99 1/26/2025
3.0.256 85 1/26/2025
3.0.255 180 1/25/2025
3.0.254 208 1/25/2025
3.0.253 87 1/25/2025
3.0.252 92 1/25/2025
3.0.251 86 1/25/2025
3.0.250 201 1/25/2025
3.0.249 380 1/24/2025
3.0.248 128 1/24/2025
3.0.247 198 1/24/2025
3.0.246 154 1/24/2025
3.0.245 257 1/24/2025
3.0.244 195 1/23/2025
3.0.243 261 1/21/2025
3.0.242 97 1/21/2025
3.0.241 172 1/21/2025
3.0.240 103 1/21/2025
3.0.239 93 1/21/2025
3.0.238 284 1/21/2025
3.0.237 92 1/21/2025
3.0.236 91 1/21/2025
3.0.235 87 1/21/2025
3.0.234 89 1/21/2025
3.0.233 89 1/20/2025
3.0.232 104 1/20/2025
3.0.231 577 1/20/2025
3.0.230 99 1/20/2025
3.0.229 87 1/20/2025
3.0.228 241 1/20/2025
3.0.227 1,827 1/14/2025
3.0.226 69 1/14/2025
3.0.225 81 1/14/2025
3.0.224 147 1/14/2025
3.0.223 190 1/13/2025
3.0.222 178 1/13/2025
3.0.221 131 1/13/2025
3.0.220 83 1/13/2025
3.0.219 79 1/13/2025
3.0.218 225 1/12/2025
3.0.217 166 1/11/2025
3.0.216 138 1/11/2025
3.0.215 141 1/11/2025
3.0.214 99 1/11/2025
3.0.213 136 1/10/2025
3.0.212 98 1/10/2025
3.0.211 85 1/10/2025
3.0.210 89 1/10/2025
3.0.209 240 1/10/2025
3.0.208 100 1/10/2025
3.0.207 95 1/10/2025
3.0.206 642 1/3/2025
3.0.205 125 1/3/2025
3.0.204 167 1/3/2025
3.0.203 121 1/3/2025
3.0.202 202 1/2/2025
3.0.201 99 1/2/2025
3.0.200 98 1/2/2025
3.0.199 182 1/2/2025
3.0.198 100 1/2/2025
3.0.197 97 1/2/2025
3.0.196 406 1/1/2025
3.0.195 180 1/1/2025
3.0.194 109 1/1/2025
3.0.193 126 1/1/2025
3.0.192 212 1/1/2025
3.0.191 103 1/1/2025
3.0.190 107 1/1/2025
3.0.189 112 12/31/2024
3.0.188 102 12/31/2024
3.0.187 105 12/31/2024
3.0.186 108 12/31/2024
3.0.185 105 12/31/2024
3.0.184 158 12/31/2024
3.0.183 115 12/31/2024
3.0.182 395 12/31/2024
3.0.181 93 12/31/2024
3.0.180 260 12/31/2024
3.0.179 163 12/31/2024
3.0.178 102 12/31/2024
3.0.177 107 12/31/2024
3.0.176 105 12/31/2024
3.0.175 91 12/31/2024
3.0.174 126 12/30/2024
3.0.173 357 12/28/2024
3.0.172 122 12/28/2024
3.0.171 156 12/27/2024
3.0.170 99 12/27/2024
3.0.169 427 12/24/2024
3.0.168 202 12/24/2024
3.0.167 125 12/24/2024
3.0.166 105 12/24/2024
3.0.165 189 12/24/2024
3.0.164 93 12/24/2024
3.0.163 190 12/24/2024
3.0.162 86 12/24/2024
3.0.161 135 12/24/2024
3.0.160 104 12/23/2024
3.0.159 163 12/23/2024
3.0.158 178 12/23/2024
3.0.157 105 12/23/2024
3.0.156 275 12/23/2024
3.0.155 116 12/23/2024
3.0.154 260 12/22/2024
3.0.153 102 12/22/2024
3.0.152 102 12/22/2024
3.0.151 209 12/22/2024
3.0.150 105 12/22/2024
3.0.149 99 12/22/2024
3.0.148 94 12/22/2024
3.0.147 278 12/22/2024
3.0.146 101 12/22/2024
3.0.145 111 12/22/2024
3.0.144 108 12/22/2024
3.0.143 264 12/21/2024
3.0.142 101 12/21/2024
3.0.141 110 12/21/2024
3.0.140 95 12/21/2024
3.0.139 106 12/21/2024
3.0.138 94 12/21/2024
3.0.137 97 12/21/2024
3.0.136 104 12/21/2024
3.0.135 287 12/21/2024
3.0.134 183 12/21/2024
3.0.133 96 12/21/2024
3.0.132 100 12/21/2024
3.0.131 89 12/21/2024
3.0.130 244 12/21/2024
3.0.129 95 12/21/2024
3.0.128 158 12/20/2024
3.0.127 94 12/20/2024
3.0.126 180 12/20/2024
3.0.125 100 12/20/2024
3.0.124 206 12/20/2024
3.0.123 180 12/20/2024
3.0.122 111 12/20/2024
3.0.121 173 12/20/2024
3.0.120 196 12/19/2024
3.0.119 185 12/19/2024
3.0.118 107 12/19/2024
3.0.117 152 12/19/2024
3.0.116 99 12/18/2024
3.0.115 147 12/18/2024
3.0.114 207 12/17/2024
3.0.113 114 12/17/2024
3.0.112 81 12/17/2024
3.0.111 221 12/16/2024
3.0.110 307 12/10/2024
3.0.109 105 12/10/2024
3.0.108 180 12/10/2024
3.0.107 101 12/9/2024
3.0.106 181 12/9/2024
3.0.105 221 12/9/2024
3.0.104 98 12/9/2024
3.0.103 299 12/7/2024
3.0.102 120 12/6/2024
3.0.101 120 12/6/2024
3.0.100 115 12/6/2024
3.0.99 121 12/6/2024
3.0.97 148 12/6/2024
3.0.96 123 12/6/2024
3.0.95 109 12/6/2024
3.0.94 109 12/6/2024
3.0.93 106 12/6/2024
3.0.92 103 12/6/2024
3.0.91 140 12/6/2024
3.0.90 129 12/5/2024
3.0.89 132 12/5/2024
3.0.88 681 12/5/2024
3.0.87 148 12/5/2024
3.0.86 149 12/5/2024
3.0.85 193 12/5/2024
3.0.84 127 12/4/2024
3.0.83 149 12/4/2024
3.0.82 208 12/4/2024
3.0.81 201 12/4/2024
3.0.80 177 12/4/2024
3.0.79 106 12/3/2024
3.0.78 202 12/3/2024
3.0.77 198 12/3/2024
3.0.76 164 12/3/2024
3.0.75 96 12/3/2024
3.0.74 148 12/3/2024
3.0.73 95 12/3/2024
3.0.72 370 12/2/2024
3.0.71 157 12/2/2024
3.0.70 174 12/2/2024
3.0.69 101 12/2/2024
3.0.68 178 12/2/2024
3.0.67 228 12/1/2024
3.0.66 107 12/1/2024
3.0.65 258 12/1/2024
3.0.64 137 12/1/2024
3.0.63 209 11/29/2024
3.0.62 182 11/29/2024
3.0.61 264 11/21/2024
3.0.60 122 11/21/2024
3.0.59 265 11/20/2024
3.0.58 107 11/20/2024
3.0.57 128 11/20/2024
3.0.56 110 11/20/2024
3.0.55 108 11/20/2024
3.0.54 121 11/20/2024
3.0.53 115 11/19/2024
3.0.52 105 11/19/2024
3.0.51 101 11/19/2024
3.0.50 389 11/19/2024
3.0.49 95 11/19/2024
3.0.48 317 11/19/2024
3.0.47 100 11/19/2024
3.0.46 105 11/19/2024
3.0.45 301 11/15/2024
3.0.44 150 11/14/2024
3.0.43 107 11/14/2024
3.0.42 99 11/14/2024
3.0.41 146 11/14/2024
3.0.40 115 11/14/2024
3.0.39 226 11/14/2024
3.0.38 324 11/14/2024
3.0.37 167 11/14/2024
3.0.36 104 11/14/2024
3.0.35 104 11/14/2024
3.0.34 151 11/14/2024
3.0.33 111 11/14/2024
3.0.32 199 11/14/2024
2.1.31 304 11/13/2024
2.1.30 191 11/13/2024
2.1.29 267 11/13/2024
2.1.28 153 11/12/2024
2.1.27 100 11/12/2024
2.1.26 657 11/9/2024
2.1.25 190 11/9/2024
2.1.24 353 11/8/2024
2.1.23 115 11/8/2024
2.1.22 111 11/8/2024
2.1.21 298 11/8/2024
2.1.20 244 11/8/2024
2.1.19 270 11/6/2024
2.1.18 347 11/1/2024
2.1.17 108 11/1/2024
2.1.16 334 11/1/2024
2.1.14 120 10/29/2024
2.1.13 265 10/29/2024
2.1.12 154 10/29/2024
2.1.11 427 10/29/2024
2.1.10 268 10/28/2024
2.1.9 104 10/28/2024
2.1.8 133 10/28/2024
2.1.7 363 10/26/2024
2.1.6 123 10/26/2024
2.1.5 269 10/22/2024
2.1.4 125 10/22/2024
2.1.3 103 10/22/2024
2.1.2 112 10/22/2024
2.1.1 129 10/22/2024