Soenneker.Utils.RateLimiting.Factory 3.0.286

Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package Soenneker.Utils.RateLimiting.Factory --version 3.0.286                
NuGet\Install-Package Soenneker.Utils.RateLimiting.Factory -Version 3.0.286                
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.Factory" Version="3.0.286" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Soenneker.Utils.RateLimiting.Factory --version 3.0.286                
#r "nuget: Soenneker.Utils.RateLimiting.Factory, 3.0.286"                
#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.
// Install Soenneker.Utils.RateLimiting.Factory as a Cake Addin
#addin nuget:?package=Soenneker.Utils.RateLimiting.Factory&version=3.0.286

// Install Soenneker.Utils.RateLimiting.Factory as a Cake Tool
#tool nuget:?package=Soenneker.Utils.RateLimiting.Factory&version=3.0.286                

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.Factory

An async thread-safe singleton dictionary for Soenneker.Utils.RateLimiting.Executors, designed to manage the rate at which tasks are executed.

Installation

dotnet add package Soenneker.Utils.RateLimiting.Factory

Usage

  1. Register IRateLimitingFactory within DI (Program.cs).
public static async Task Main(string[] args)
{
    ...
    builder.Services.AddRateLimitingFactoryAsSingleton();
}
  1. Inject IRateLimitingFactory, and retrieve a RateLimitingFactory.

Example:

public class TestClass
{
    IRateLimitingFactory _factory;

    public TestClass(IRateLimitingFactory factory)
    {
        _factory = factory;
    }

    public async ValueTask ExecuteTasks()
    {
        RateLimitingExecutor rateLimitingExecutor = await _factory.Get("test", TimeSpan.FromSeconds(2));

        for (int i = 0; i < 5; i++)
        {
            await rateLimitingExecutor.Execute(async ct =>
            {
                Logger.LogInformation($"Executing Task {i + 1} at {DateTime.Now:HH:mm:ss}");

                await Task.Delay(100, ct); // 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on Soenneker.Utils.RateLimiting.Factory:

Package Downloads
Soenneker.Validators.Yahoo.Exists

A validation module checking for Yahoo account existence

Soenneker.Validators.Gmail.Exists

A validation module checking for Gmail account existence

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
3.0.309 109 12/24/2024
3.0.308 94 12/24/2024
3.0.307 67 12/24/2024
3.0.306 63 12/24/2024
3.0.305 114 12/24/2024
3.0.304 77 12/24/2024
3.0.303 91 12/24/2024
3.0.302 62 12/24/2024
3.0.301 64 12/24/2024
3.0.300 141 12/24/2024
3.0.299 143 12/24/2024
3.0.298 92 12/24/2024
3.0.297 62 12/24/2024
3.0.296 69 12/24/2024
3.0.295 67 12/24/2024
3.0.294 98 12/24/2024
3.0.293 65 12/24/2024
3.0.292 98 12/23/2024
3.0.291 57 12/23/2024
3.0.290 78 12/23/2024
3.0.289 66 12/23/2024
3.0.288 120 12/23/2024
3.0.287 170 12/23/2024
3.0.286 63 12/23/2024
3.0.285 121 12/23/2024
3.0.284 69 12/23/2024
3.0.283 66 12/23/2024
3.0.282 92 12/23/2024
3.0.281 64 12/23/2024
3.0.280 179 12/23/2024
3.0.279 63 12/23/2024
3.0.278 100 12/22/2024
3.0.277 62 12/22/2024
3.0.276 68 12/22/2024
3.0.275 142 12/22/2024
3.0.274 75 12/22/2024
3.0.273 67 12/22/2024
3.0.272 75 12/22/2024
3.0.271 185 12/22/2024
3.0.270 67 12/22/2024
3.0.269 118 12/22/2024
3.0.268 160 12/22/2024
3.0.267 69 12/22/2024
3.0.266 97 12/22/2024
3.0.265 94 12/21/2024
3.0.264 79 12/21/2024
3.0.263 86 12/21/2024
3.0.262 68 12/21/2024
3.0.261 208 12/21/2024
3.0.260 68 12/21/2024
3.0.259 103 12/21/2024
3.0.258 68 12/21/2024
3.0.257 138 12/21/2024
3.0.256 73 12/21/2024
3.0.255 66 12/21/2024
3.0.254 186 12/21/2024
3.0.253 69 12/21/2024
3.0.252 63 12/21/2024
3.0.251 106 12/20/2024
3.0.250 63 12/20/2024
3.0.249 128 12/20/2024
3.0.248 70 12/20/2024
3.0.247 61 12/20/2024
3.0.246 145 12/20/2024
3.0.245 131 12/20/2024
3.0.244 64 12/20/2024
3.0.243 71 12/20/2024
3.0.242 70 12/20/2024
3.0.241 129 12/20/2024
3.0.240 76 12/20/2024
3.0.239 75 12/20/2024
3.0.238 149 12/19/2024
3.0.237 67 12/19/2024
3.0.236 102 12/19/2024
3.0.235 88 12/19/2024
3.0.234 67 12/19/2024
3.0.233 62 12/19/2024
3.0.232 114 12/19/2024
3.0.231 62 12/19/2024
3.0.230 98 12/18/2024
3.0.229 67 12/18/2024
3.0.228 69 12/18/2024
3.0.227 157 12/17/2024
3.0.225 101 12/17/2024
3.0.224 132 12/17/2024
3.0.223 89 12/16/2024
3.0.222 61 12/16/2024
3.0.221 66 12/16/2024
3.0.220 74 12/16/2024
3.0.219 260 12/10/2024
3.0.218 61 12/10/2024
3.0.217 87 12/10/2024
3.0.216 74 12/10/2024
3.0.215 112 12/10/2024
3.0.214 68 12/10/2024
3.0.213 82 12/9/2024
3.0.212 81 12/9/2024
3.0.211 114 12/9/2024
3.0.210 155 12/9/2024
3.0.209 72 12/9/2024
3.0.208 79 12/9/2024
3.0.207 64 12/9/2024
3.0.206 68 12/9/2024
3.0.205 118 12/9/2024
3.0.204 64 12/9/2024
3.0.203 191 12/7/2024
3.0.202 81 12/7/2024
3.0.201 73 12/7/2024
3.0.200 70 12/6/2024
3.0.199 67 12/6/2024
3.0.198 81 12/6/2024
3.0.197 74 12/6/2024
3.0.196 76 12/6/2024
3.0.195 76 12/6/2024
3.0.194 78 12/6/2024
3.0.193 71 12/6/2024
3.0.192 78 12/6/2024
3.0.191 84 12/6/2024
3.0.190 79 12/6/2024
3.0.189 82 12/6/2024
3.0.188 80 12/6/2024
3.0.187 95 12/6/2024
3.0.184 88 12/6/2024
3.0.183 76 12/6/2024
3.0.182 73 12/6/2024
3.0.181 86 12/5/2024
3.0.180 82 12/5/2024
3.0.179 77 12/5/2024
3.0.178 629 12/5/2024
3.0.177 90 12/5/2024
3.0.176 78 12/5/2024
3.0.175 100 12/5/2024
3.0.174 67 12/5/2024
3.0.173 94 12/5/2024
3.0.172 115 12/5/2024
3.0.171 72 12/5/2024
3.0.170 107 12/5/2024
3.0.169 80 12/5/2024
3.0.168 83 12/5/2024
3.0.167 74 12/4/2024
3.0.166 75 12/4/2024
3.0.165 125 12/4/2024
3.0.164 78 12/4/2024
3.0.163 162 12/4/2024
3.0.162 106 12/4/2024
3.0.161 84 12/4/2024
3.0.160 111 12/4/2024
3.0.159 74 12/4/2024
3.0.158 130 12/4/2024
3.0.157 74 12/4/2024
3.0.156 71 12/4/2024
3.0.155 152 12/4/2024
3.0.154 73 12/3/2024
3.0.153 70 12/3/2024
3.0.152 110 12/3/2024
3.0.151 65 12/3/2024
3.0.150 100 12/3/2024
3.0.149 70 12/3/2024
3.0.148 75 12/3/2024
3.0.147 70 12/3/2024
3.0.146 117 12/3/2024
3.0.145 66 12/3/2024
3.0.144 77 12/3/2024
3.0.143 116 12/3/2024
3.0.142 70 12/3/2024
3.0.141 312 12/2/2024
3.0.140 78 12/2/2024
3.0.139 71 12/2/2024
3.0.138 61 12/2/2024
3.0.137 122 12/2/2024
3.0.136 80 12/2/2024
3.0.135 75 12/2/2024
3.0.134 129 12/2/2024
3.0.133 69 12/2/2024
3.0.132 133 12/2/2024
3.0.131 71 12/2/2024
3.0.130 174 12/2/2024
3.0.129 71 12/2/2024
3.0.128 72 12/1/2024
3.0.127 72 12/1/2024
3.0.126 112 12/1/2024
3.0.125 75 12/1/2024
3.0.124 166 12/1/2024
3.0.123 86 12/1/2024
3.0.122 77 12/1/2024
3.0.121 76 12/1/2024
3.0.120 163 11/29/2024
3.0.119 100 11/29/2024
3.0.118 75 11/29/2024
3.0.117 115 11/29/2024
3.0.116 71 11/29/2024
3.0.115 108 11/29/2024
3.0.114 89 11/29/2024
3.0.113 154 11/21/2024
3.0.112 93 11/21/2024
3.0.111 73 11/21/2024
3.0.110 79 11/21/2024
3.0.109 103 11/21/2024
3.0.108 82 11/21/2024
3.0.107 177 11/20/2024
3.0.106 87 11/20/2024
3.0.105 77 11/20/2024
3.0.104 96 11/20/2024
3.0.103 76 11/20/2024
3.0.102 71 11/20/2024
3.0.101 78 11/20/2024
3.0.100 79 11/19/2024
3.0.99 75 11/19/2024
3.0.98 71 11/19/2024
3.0.97 338 11/19/2024
3.0.96 202 11/19/2024
3.0.95 66 11/19/2024
3.0.94 68 11/19/2024
3.0.93 142 11/19/2024
3.0.92 68 11/19/2024
3.0.91 96 11/19/2024
3.0.90 76 11/19/2024
3.0.89 224 11/15/2024
3.0.88 100 11/15/2024
3.0.87 69 11/15/2024
3.0.86 76 11/14/2024
3.0.85 71 11/14/2024
3.0.84 114 11/14/2024
3.0.83 70 11/14/2024
3.0.82 77 11/14/2024
3.0.81 72 11/14/2024
3.0.80 123 11/14/2024
3.0.79 119 11/14/2024
3.0.78 81 11/14/2024
3.0.77 72 11/14/2024
3.0.76 164 11/14/2024
3.0.75 79 11/14/2024
3.0.74 118 11/14/2024
3.0.73 159 11/14/2024
3.0.72 80 11/14/2024
3.0.71 138 11/14/2024
3.0.70 77 11/14/2024
3.0.69 99 11/14/2024
3.0.68 88 11/14/2024
3.0.67 170 11/14/2024
3.0.66 78 11/14/2024
3.0.65 79 11/14/2024
2.1.64 260 11/13/2024
2.1.63 94 11/13/2024
2.1.62 105 11/13/2024
2.1.61 76 11/13/2024
2.1.60 69 11/13/2024
2.1.59 213 11/13/2024
2.1.58 78 11/13/2024
2.1.57 78 11/13/2024
2.1.56 116 11/12/2024
2.1.55 74 11/12/2024
2.1.54 595 11/9/2024
2.1.53 110 11/9/2024
2.1.52 83 11/9/2024
2.1.51 125 11/9/2024
2.1.50 83 11/9/2024
2.1.49 81 11/9/2024
2.1.48 82 11/9/2024
2.1.47 215 11/9/2024
2.1.46 198 11/8/2024
2.1.45 86 11/8/2024
2.1.44 90 11/8/2024
2.1.43 108 11/8/2024
2.1.42 87 11/8/2024
2.1.41 200 11/8/2024
2.1.40 85 11/8/2024
2.1.39 86 11/8/2024
2.1.38 175 11/8/2024
2.1.37 79 11/8/2024
2.1.36 239 11/6/2024
2.1.35 129 11/6/2024
2.1.34 264 11/1/2024
2.1.33 114 11/1/2024
2.1.32 86 11/1/2024
2.1.31 113 11/1/2024
2.1.30 143 11/1/2024
2.1.29 142 11/1/2024
2.1.28 90 11/1/2024
2.1.26 207 10/29/2024
2.1.25 76 10/29/2024
2.1.24 76 10/29/2024
2.1.23 88 10/29/2024
2.1.22 81 10/29/2024
2.1.21 75 10/29/2024
2.1.20 213 10/29/2024
2.1.19 183 10/29/2024
2.1.18 116 10/29/2024
2.1.17 83 10/29/2024
2.1.16 74 10/29/2024
2.1.15 199 10/28/2024
2.1.14 81 10/28/2024
2.1.13 77 10/28/2024
2.1.12 304 10/26/2024
2.1.11 81 10/26/2024
2.1.10 81 10/26/2024
2.1.9 74 10/26/2024
2.1.8 83 10/26/2024
2.1.7 79 10/26/2024
2.1.6 205 10/22/2024
2.1.5 81 10/22/2024
2.1.4 81 10/22/2024
2.1.3 84 10/22/2024
2.1.2 86 10/22/2024
2.1.1 87 10/22/2024