Soenneker.Utils.RateLimiting.Executor 3.0.51

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.51
                    
NuGet\Install-Package Soenneker.Utils.RateLimiting.Executor -Version 3.0.51
                    
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.51" />
                    
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.51" />
                    
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.51
                    
#r "nuget: Soenneker.Utils.RateLimiting.Executor, 3.0.51"
                    
#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.51
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.Utils.RateLimiting.Executor&version=3.0.51
                    
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 163 7/9/2025
3.0.427 304 7/4/2025
3.0.426 252 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 706 6/11/2025
3.0.420 452 6/3/2025
3.0.419 347 5/27/2025
3.0.418 141 5/27/2025
3.0.417 215 5/27/2025
3.0.416 465 5/23/2025
3.0.415 135 5/23/2025
3.0.414 152 5/22/2025
3.0.413 692 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 139 5/5/2025
3.0.407 200 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 179 4/8/2025
3.0.400 162 4/8/2025
3.0.399 179 4/8/2025
3.0.398 165 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 176 4/7/2025
3.0.392 179 4/7/2025
3.0.391 160 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 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 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 196 4/1/2025
3.0.371 224 4/1/2025
3.0.370 196 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 417 3/12/2025
3.0.354 189 3/12/2025
3.0.353 246 3/12/2025
3.0.352 178 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 344 3/7/2025
3.0.345 331 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 99 3/1/2025
3.0.337 97 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 146 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 391 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 191 2/22/2025
3.0.320 135 2/22/2025
3.0.319 200 2/22/2025
3.0.318 98 2/21/2025
3.0.317 224 2/21/2025
3.0.316 269 2/21/2025
3.0.315 324 2/19/2025
3.0.314 133 2/19/2025
3.0.313 135 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 190 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 185 2/11/2025
3.0.300 310 2/11/2025
3.0.299 260 2/11/2025
3.0.298 105 2/11/2025
3.0.297 192 2/11/2025
3.0.296 202 2/10/2025
3.0.295 155 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 389 2/9/2025
3.0.290 114 2/8/2025
3.0.289 89 2/8/2025
3.0.288 96 2/8/2025
3.0.287 106 2/8/2025
3.0.286 325 2/8/2025
3.0.285 119 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 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 103 2/5/2025
3.0.272 118 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 513 1/28/2025
3.0.267 98 1/28/2025
3.0.266 110 1/28/2025
3.0.265 326 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 105 1/26/2025
3.0.256 86 1/26/2025
3.0.255 184 1/25/2025
3.0.254 212 1/25/2025
3.0.253 88 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 156 1/24/2025
3.0.245 263 1/24/2025
3.0.244 197 1/23/2025
3.0.243 266 1/21/2025
3.0.242 103 1/21/2025
3.0.241 173 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 94 1/21/2025
3.0.233 90 1/20/2025
3.0.232 108 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 227 1/12/2025
3.0.217 168 1/11/2025
3.0.216 141 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 100 1/10/2025
3.0.211 85 1/10/2025
3.0.210 94 1/10/2025
3.0.209 242 1/10/2025
3.0.208 102 1/10/2025
3.0.207 101 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 123 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 185 1/2/2025
3.0.198 102 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 111 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 116 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 109 12/31/2024
3.0.184 163 12/31/2024
3.0.183 118 12/31/2024
3.0.182 399 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 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 162 12/27/2024
3.0.170 99 12/27/2024
3.0.169 430 12/24/2024
3.0.168 205 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 190 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 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 107 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 115 12/22/2024
3.0.144 111 12/22/2024
3.0.143 268 12/21/2024
3.0.142 105 12/21/2024
3.0.141 112 12/21/2024
3.0.140 97 12/21/2024
3.0.139 111 12/21/2024
3.0.138 98 12/21/2024
3.0.137 99 12/21/2024
3.0.136 107 12/21/2024
3.0.135 288 12/21/2024
3.0.134 187 12/21/2024
3.0.133 97 12/21/2024
3.0.132 101 12/21/2024
3.0.131 94 12/21/2024
3.0.130 246 12/21/2024
3.0.129 100 12/21/2024
3.0.128 161 12/20/2024
3.0.127 99 12/20/2024
3.0.126 184 12/20/2024
3.0.125 104 12/20/2024
3.0.124 208 12/20/2024
3.0.123 182 12/20/2024
3.0.122 114 12/20/2024
3.0.121 175 12/20/2024
3.0.120 198 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 211 12/17/2024
3.0.113 118 12/17/2024
3.0.112 86 12/17/2024
3.0.111 223 12/16/2024
3.0.110 309 12/10/2024
3.0.109 109 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 224 12/9/2024
3.0.104 102 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 118 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 108 12/6/2024
3.0.92 105 12/6/2024
3.0.91 144 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 134 12/4/2024
3.0.83 152 12/4/2024
3.0.82 211 12/4/2024
3.0.81 205 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 100 12/3/2024
3.0.72 373 12/2/2024
3.0.71 160 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 230 12/1/2024
3.0.66 109 12/1/2024
3.0.65 261 12/1/2024
3.0.64 141 12/1/2024
3.0.63 214 11/29/2024
3.0.62 184 11/29/2024
3.0.61 264 11/21/2024
3.0.60 125 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 125 11/20/2024
3.0.53 116 11/19/2024
3.0.52 107 11/19/2024
3.0.51 103 11/19/2024
3.0.50 390 11/19/2024
3.0.49 97 11/19/2024
3.0.48 319 11/19/2024
3.0.47 101 11/19/2024
3.0.46 107 11/19/2024
3.0.45 308 11/15/2024
3.0.44 152 11/14/2024
3.0.43 108 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 326 11/14/2024
3.0.37 172 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 116 11/14/2024
3.0.32 201 11/14/2024
2.1.31 306 11/13/2024
2.1.30 193 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 658 11/9/2024
2.1.25 195 11/9/2024
2.1.24 359 11/8/2024
2.1.23 119 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 350 11/1/2024
2.1.17 113 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 271 10/28/2024
2.1.9 105 10/28/2024
2.1.8 142 10/28/2024
2.1.7 364 10/26/2024
2.1.6 126 10/26/2024
2.1.5 273 10/22/2024
2.1.4 126 10/22/2024
2.1.3 108 10/22/2024
2.1.2 114 10/22/2024
2.1.1 132 10/22/2024