Soenneker.Utils.RateLimiting.Executor 3.0.427

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