Soenneker.Utils.RateLimiting.Executor 3.0.399

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.399
                    
NuGet\Install-Package Soenneker.Utils.RateLimiting.Executor -Version 3.0.399
                    
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.399" />
                    
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.399" />
                    
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.399
                    
#r "nuget: Soenneker.Utils.RateLimiting.Executor, 3.0.399"
                    
#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.399
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.Utils.RateLimiting.Executor&version=3.0.399
                    
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 169 7/9/2025
3.0.427 306 7/4/2025
3.0.426 253 7/3/2025
3.0.425 294 6/28/2025
3.0.424 141 6/27/2025
3.0.423 58 6/27/2025
3.0.422 71 6/27/2025
3.0.421 708 6/11/2025
3.0.420 452 6/3/2025
3.0.419 348 5/27/2025
3.0.418 142 5/27/2025
3.0.417 215 5/27/2025
3.0.416 465 5/23/2025
3.0.415 136 5/23/2025
3.0.414 152 5/22/2025
3.0.413 693 5/8/2025
3.0.412 160 5/7/2025
3.0.411 148 5/7/2025
3.0.410 431 5/5/2025
3.0.409 236 5/5/2025
3.0.408 140 5/5/2025
3.0.407 201 5/5/2025
3.0.406 155 5/5/2025
3.0.405 779 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 180 4/8/2025
3.0.400 164 4/8/2025
3.0.399 179 4/8/2025
3.0.398 167 4/8/2025
3.0.397 489 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 177 4/7/2025
3.0.392 180 4/7/2025
3.0.391 161 4/6/2025
3.0.390 160 4/6/2025
3.0.389 144 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 107 4/6/2025
3.0.384 112 4/6/2025
3.0.383 115 4/5/2025
3.0.382 95 4/5/2025
3.0.381 79 4/5/2025
3.0.380 93 4/5/2025
3.0.379 95 4/5/2025
3.0.378 88 4/5/2025
3.0.377 86 4/5/2025
3.0.376 115 4/4/2025
3.0.375 105 4/4/2025
3.0.374 1,355 4/3/2025
3.0.373 262 4/1/2025
3.0.372 197 4/1/2025
3.0.371 224 4/1/2025
3.0.370 198 3/31/2025
3.0.369 156 3/31/2025
3.0.368 227 3/31/2025
3.0.367 305 3/31/2025
3.0.366 179 3/29/2025
3.0.365 87 3/29/2025
3.0.364 122 3/29/2025
3.0.363 672 3/25/2025
3.0.362 497 3/25/2025
3.0.361 316 3/21/2025
3.0.360 168 3/21/2025
3.0.359 418 3/18/2025
3.0.358 238 3/18/2025
3.0.357 213 3/15/2025
3.0.356 68 3/15/2025
3.0.355 418 3/12/2025
3.0.354 189 3/12/2025
3.0.353 247 3/12/2025
3.0.352 179 3/11/2025
3.0.351 319 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 377 3/7/2025
3.0.346 345 3/7/2025
3.0.345 332 3/2/2025
3.0.344 147 3/2/2025
3.0.343 153 3/2/2025
3.0.342 96 3/2/2025
3.0.341 110 3/2/2025
3.0.340 217 3/2/2025
3.0.339 212 3/1/2025
3.0.338 100 3/1/2025
3.0.337 98 3/1/2025
3.0.336 415 3/1/2025
3.0.335 124 3/1/2025
3.0.334 84 3/1/2025
3.0.333 200 3/1/2025
3.0.332 88 3/1/2025
3.0.331 91 3/1/2025
3.0.330 314 2/25/2025
3.0.329 147 2/25/2025
3.0.328 184 2/25/2025
3.0.327 210 2/25/2025
3.0.326 158 2/25/2025
3.0.325 392 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 193 2/22/2025
3.0.320 136 2/22/2025
3.0.319 200 2/22/2025
3.0.318 99 2/21/2025
3.0.317 225 2/21/2025
3.0.316 269 2/21/2025
3.0.315 325 2/19/2025
3.0.314 133 2/19/2025
3.0.313 135 2/19/2025
3.0.312 113 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 191 2/13/2025
3.0.305 410 2/12/2025
3.0.304 120 2/12/2025
3.0.303 192 2/12/2025
3.0.302 201 2/11/2025
3.0.301 186 2/11/2025
3.0.300 310 2/11/2025
3.0.299 260 2/11/2025
3.0.298 106 2/11/2025
3.0.297 192 2/11/2025
3.0.296 202 2/10/2025
3.0.295 156 2/10/2025
3.0.294 200 2/10/2025
3.0.293 104 2/10/2025
3.0.292 103 2/10/2025
3.0.291 389 2/9/2025
3.0.290 115 2/8/2025
3.0.289 89 2/8/2025
3.0.288 96 2/8/2025
3.0.287 107 2/8/2025
3.0.286 326 2/8/2025
3.0.285 120 2/7/2025
3.0.284 151 2/7/2025
3.0.283 262 2/7/2025
3.0.282 98 2/7/2025
3.0.281 93 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 113 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 103 2/5/2025
3.0.272 119 2/5/2025
3.0.271 246 2/5/2025
3.0.270 111 2/5/2025
3.0.269 102 2/5/2025
3.0.268 514 1/28/2025
3.0.267 99 1/28/2025
3.0.266 110 1/28/2025
3.0.265 327 1/27/2025
3.0.264 110 1/27/2025
3.0.263 90 1/27/2025
3.0.262 85 1/27/2025
3.0.261 152 1/27/2025
3.0.260 107 1/27/2025
3.0.259 283 1/26/2025
3.0.258 111 1/26/2025
3.0.257 106 1/26/2025
3.0.256 86 1/26/2025
3.0.255 185 1/25/2025
3.0.254 212 1/25/2025
3.0.253 89 1/25/2025
3.0.252 97 1/25/2025
3.0.251 88 1/25/2025
3.0.250 202 1/25/2025
3.0.249 384 1/24/2025
3.0.248 132 1/24/2025
3.0.247 201 1/24/2025
3.0.246 157 1/24/2025
3.0.245 263 1/24/2025
3.0.244 197 1/23/2025
3.0.243 267 1/21/2025
3.0.242 104 1/21/2025
3.0.241 174 1/21/2025
3.0.240 106 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 94 1/21/2025
3.0.235 88 1/21/2025
3.0.234 96 1/21/2025
3.0.233 90 1/20/2025
3.0.232 109 1/20/2025
3.0.231 580 1/20/2025
3.0.230 99 1/20/2025
3.0.229 91 1/20/2025
3.0.228 242 1/20/2025
3.0.227 1,828 1/14/2025
3.0.226 74 1/14/2025
3.0.225 81 1/14/2025
3.0.224 148 1/14/2025
3.0.223 194 1/13/2025
3.0.222 180 1/13/2025
3.0.221 132 1/13/2025
3.0.220 87 1/13/2025
3.0.219 79 1/13/2025
3.0.218 228 1/12/2025
3.0.217 168 1/11/2025
3.0.216 142 1/11/2025
3.0.215 145 1/11/2025
3.0.214 102 1/11/2025
3.0.213 137 1/10/2025
3.0.212 101 1/10/2025
3.0.211 85 1/10/2025
3.0.210 94 1/10/2025
3.0.209 243 1/10/2025
3.0.208 103 1/10/2025
3.0.207 102 1/10/2025
3.0.206 645 1/3/2025
3.0.205 128 1/3/2025
3.0.204 168 1/3/2025
3.0.203 124 1/3/2025
3.0.202 205 1/2/2025
3.0.201 103 1/2/2025
3.0.200 101 1/2/2025
3.0.199 187 1/2/2025
3.0.198 103 1/2/2025
3.0.197 99 1/2/2025
3.0.196 410 1/1/2025
3.0.195 184 1/1/2025
3.0.194 113 1/1/2025
3.0.193 130 1/1/2025
3.0.192 214 1/1/2025
3.0.191 104 1/1/2025
3.0.190 108 1/1/2025
3.0.189 117 12/31/2024
3.0.188 104 12/31/2024
3.0.187 106 12/31/2024
3.0.186 110 12/31/2024
3.0.185 110 12/31/2024
3.0.184 164 12/31/2024
3.0.183 119 12/31/2024
3.0.182 400 12/31/2024
3.0.181 96 12/31/2024
3.0.180 262 12/31/2024
3.0.179 168 12/31/2024
3.0.178 103 12/31/2024
3.0.177 108 12/31/2024
3.0.176 105 12/31/2024
3.0.175 94 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 162 12/27/2024
3.0.170 99 12/27/2024
3.0.169 430 12/24/2024
3.0.168 206 12/24/2024
3.0.167 127 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 192 12/24/2024
3.0.162 87 12/24/2024
3.0.161 137 12/24/2024
3.0.160 106 12/23/2024
3.0.159 163 12/23/2024
3.0.158 181 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 263 12/22/2024
3.0.153 103 12/22/2024
3.0.152 106 12/22/2024
3.0.151 211 12/22/2024
3.0.150 109 12/22/2024
3.0.149 103 12/22/2024
3.0.148 98 12/22/2024
3.0.147 280 12/22/2024
3.0.146 105 12/22/2024
3.0.145 116 12/22/2024
3.0.144 112 12/22/2024
3.0.143 269 12/21/2024
3.0.142 106 12/21/2024
3.0.141 113 12/21/2024
3.0.140 99 12/21/2024
3.0.139 112 12/21/2024
3.0.138 99 12/21/2024
3.0.137 100 12/21/2024
3.0.136 108 12/21/2024
3.0.135 289 12/21/2024
3.0.134 189 12/21/2024
3.0.133 98 12/21/2024
3.0.132 102 12/21/2024
3.0.131 96 12/21/2024
3.0.130 247 12/21/2024
3.0.129 101 12/21/2024
3.0.128 163 12/20/2024
3.0.127 101 12/20/2024
3.0.126 185 12/20/2024
3.0.125 106 12/20/2024
3.0.124 209 12/20/2024
3.0.123 184 12/20/2024
3.0.122 115 12/20/2024
3.0.121 177 12/20/2024
3.0.120 200 12/19/2024
3.0.119 187 12/19/2024
3.0.118 109 12/19/2024
3.0.117 155 12/19/2024
3.0.116 100 12/18/2024
3.0.115 150 12/18/2024
3.0.114 214 12/17/2024
3.0.113 120 12/17/2024
3.0.112 87 12/17/2024
3.0.111 224 12/16/2024
3.0.110 310 12/10/2024
3.0.109 110 12/10/2024
3.0.108 181 12/10/2024
3.0.107 104 12/9/2024
3.0.106 182 12/9/2024
3.0.105 225 12/9/2024
3.0.104 104 12/9/2024
3.0.103 302 12/7/2024
3.0.102 126 12/6/2024
3.0.101 122 12/6/2024
3.0.100 119 12/6/2024
3.0.99 126 12/6/2024
3.0.97 151 12/6/2024
3.0.96 128 12/6/2024
3.0.95 111 12/6/2024
3.0.94 111 12/6/2024
3.0.93 109 12/6/2024
3.0.92 106 12/6/2024
3.0.91 146 12/6/2024
3.0.90 131 12/5/2024
3.0.89 135 12/5/2024
3.0.88 685 12/5/2024
3.0.87 152 12/5/2024
3.0.86 151 12/5/2024
3.0.85 198 12/5/2024
3.0.84 135 12/4/2024
3.0.83 155 12/4/2024
3.0.82 212 12/4/2024
3.0.81 208 12/4/2024
3.0.80 181 12/4/2024
3.0.79 108 12/3/2024
3.0.78 206 12/3/2024
3.0.77 199 12/3/2024
3.0.76 167 12/3/2024
3.0.75 99 12/3/2024
3.0.74 150 12/3/2024
3.0.73 101 12/3/2024
3.0.72 375 12/2/2024
3.0.71 161 12/2/2024
3.0.70 177 12/2/2024
3.0.69 102 12/2/2024
3.0.68 182 12/2/2024
3.0.67 231 12/1/2024
3.0.66 111 12/1/2024
3.0.65 263 12/1/2024
3.0.64 143 12/1/2024
3.0.63 215 11/29/2024
3.0.62 185 11/29/2024
3.0.61 265 11/21/2024
3.0.60 126 11/21/2024
3.0.59 269 11/20/2024
3.0.58 109 11/20/2024
3.0.57 132 11/20/2024
3.0.56 113 11/20/2024
3.0.55 110 11/20/2024
3.0.54 126 11/20/2024
3.0.53 117 11/19/2024
3.0.52 108 11/19/2024
3.0.51 104 11/19/2024
3.0.50 391 11/19/2024
3.0.49 100 11/19/2024
3.0.48 320 11/19/2024
3.0.47 102 11/19/2024
3.0.46 108 11/19/2024
3.0.45 309 11/15/2024
3.0.44 153 11/14/2024
3.0.43 109 11/14/2024
3.0.42 101 11/14/2024
3.0.41 150 11/14/2024
3.0.40 121 11/14/2024
3.0.39 229 11/14/2024
3.0.38 327 11/14/2024
3.0.37 173 11/14/2024
3.0.36 112 11/14/2024
3.0.35 105 11/14/2024
3.0.34 155 11/14/2024
3.0.33 118 11/14/2024
3.0.32 202 11/14/2024
2.1.31 307 11/13/2024
2.1.30 194 11/13/2024
2.1.29 272 11/13/2024
2.1.28 157 11/12/2024
2.1.27 101 11/12/2024
2.1.26 658 11/9/2024
2.1.25 196 11/9/2024
2.1.24 360 11/8/2024
2.1.23 120 11/8/2024
2.1.22 112 11/8/2024
2.1.21 300 11/8/2024
2.1.20 247 11/8/2024
2.1.19 275 11/6/2024
2.1.18 351 11/1/2024
2.1.17 114 11/1/2024
2.1.16 341 11/1/2024
2.1.14 122 10/29/2024
2.1.13 266 10/29/2024
2.1.12 163 10/29/2024
2.1.11 430 10/29/2024
2.1.10 272 10/28/2024
2.1.9 105 10/28/2024
2.1.8 143 10/28/2024
2.1.7 364 10/26/2024
2.1.6 127 10/26/2024
2.1.5 273 10/22/2024
2.1.4 126 10/22/2024
2.1.3 109 10/22/2024
2.1.2 114 10/22/2024
2.1.1 132 10/22/2024