Soenneker.Utils.RateLimiting.Factory 3.0.187

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.187                
NuGet\Install-Package Soenneker.Utils.RateLimiting.Factory -Version 3.0.187                
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.187" />                
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.187                
#r "nuget: Soenneker.Utils.RateLimiting.Factory, 3.0.187"                
#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.187

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

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.219 59 12/10/2024
3.0.218 21 12/10/2024
3.0.217 41 12/10/2024
3.0.216 29 12/10/2024
3.0.215 53 12/10/2024
3.0.214 26 12/10/2024
3.0.213 40 12/9/2024
3.0.212 37 12/9/2024
3.0.211 51 12/9/2024
3.0.210 87 12/9/2024
3.0.209 33 12/9/2024
3.0.208 37 12/9/2024
3.0.207 27 12/9/2024
3.0.206 23 12/9/2024
3.0.205 66 12/9/2024
3.0.204 33 12/9/2024
3.0.203 101 12/7/2024
3.0.202 40 12/7/2024
3.0.201 35 12/7/2024
3.0.200 37 12/6/2024
3.0.199 31 12/6/2024
3.0.198 40 12/6/2024
3.0.197 34 12/6/2024
3.0.196 38 12/6/2024
3.0.195 33 12/6/2024
3.0.194 37 12/6/2024
3.0.193 31 12/6/2024
3.0.192 43 12/6/2024
3.0.191 42 12/6/2024
3.0.190 38 12/6/2024
3.0.189 39 12/6/2024
3.0.188 40 12/6/2024
3.0.187 55 12/6/2024
3.0.184 47 12/6/2024
3.0.183 35 12/6/2024
3.0.182 32 12/6/2024
3.0.181 43 12/5/2024
3.0.180 44 12/5/2024
3.0.179 34 12/5/2024
3.0.178 361 12/5/2024
3.0.177 43 12/5/2024
3.0.176 38 12/5/2024
3.0.175 52 12/5/2024
3.0.174 33 12/5/2024
3.0.173 49 12/5/2024
3.0.172 60 12/5/2024
3.0.171 35 12/5/2024
3.0.170 52 12/5/2024
3.0.169 36 12/5/2024
3.0.168 42 12/5/2024
3.0.167 36 12/4/2024
3.0.166 34 12/4/2024
3.0.165 72 12/4/2024
3.0.164 35 12/4/2024
3.0.163 72 12/4/2024
3.0.162 60 12/4/2024
3.0.161 50 12/4/2024
3.0.160 87 12/4/2024
3.0.159 53 12/4/2024
3.0.158 99 12/4/2024
3.0.157 63 12/4/2024
3.0.156 60 12/4/2024
3.0.155 101 12/4/2024
3.0.154 63 12/3/2024
3.0.153 58 12/3/2024
3.0.152 92 12/3/2024
3.0.151 55 12/3/2024
3.0.150 88 12/3/2024
3.0.149 58 12/3/2024
3.0.148 63 12/3/2024
3.0.147 60 12/3/2024
3.0.146 108 12/3/2024
3.0.145 58 12/3/2024
3.0.144 69 12/3/2024
3.0.143 108 12/3/2024
3.0.142 62 12/3/2024
3.0.141 285 12/2/2024
3.0.140 68 12/2/2024
3.0.139 62 12/2/2024
3.0.138 53 12/2/2024
3.0.137 108 12/2/2024
3.0.136 67 12/2/2024
3.0.135 66 12/2/2024
3.0.134 117 12/2/2024
3.0.133 60 12/2/2024
3.0.132 121 12/2/2024
3.0.131 58 12/2/2024
3.0.130 162 12/2/2024
3.0.129 60 12/2/2024
3.0.128 62 12/1/2024
3.0.127 62 12/1/2024
3.0.126 102 12/1/2024
3.0.125 65 12/1/2024
3.0.124 157 12/1/2024
3.0.123 76 12/1/2024
3.0.122 67 12/1/2024
3.0.121 65 12/1/2024
3.0.120 157 11/29/2024
3.0.119 92 11/29/2024
3.0.118 69 11/29/2024
3.0.117 109 11/29/2024
3.0.116 65 11/29/2024
3.0.115 102 11/29/2024
3.0.114 85 11/29/2024
3.0.113 151 11/21/2024
3.0.112 90 11/21/2024
3.0.111 68 11/21/2024
3.0.110 74 11/21/2024
3.0.109 100 11/21/2024
3.0.108 79 11/21/2024
3.0.107 174 11/20/2024
3.0.106 84 11/20/2024
3.0.105 74 11/20/2024
3.0.104 93 11/20/2024
3.0.103 73 11/20/2024
3.0.102 68 11/20/2024
3.0.101 75 11/20/2024
3.0.100 72 11/19/2024
3.0.99 72 11/19/2024
3.0.98 68 11/19/2024
3.0.97 335 11/19/2024
3.0.96 199 11/19/2024
3.0.95 63 11/19/2024
3.0.94 63 11/19/2024
3.0.93 137 11/19/2024
3.0.92 61 11/19/2024
3.0.91 93 11/19/2024
3.0.90 71 11/19/2024
3.0.89 221 11/15/2024
3.0.88 97 11/15/2024
3.0.87 66 11/15/2024
3.0.86 73 11/14/2024
3.0.85 66 11/14/2024
3.0.84 111 11/14/2024
3.0.83 67 11/14/2024
3.0.82 74 11/14/2024
3.0.81 69 11/14/2024
3.0.80 120 11/14/2024
3.0.79 116 11/14/2024
3.0.78 78 11/14/2024
3.0.77 69 11/14/2024
3.0.76 161 11/14/2024
3.0.75 74 11/14/2024
3.0.74 115 11/14/2024
3.0.73 152 11/14/2024
3.0.72 77 11/14/2024
3.0.71 133 11/14/2024
3.0.70 72 11/14/2024
3.0.69 96 11/14/2024
3.0.68 83 11/14/2024
3.0.67 167 11/14/2024
3.0.66 75 11/14/2024
3.0.65 76 11/14/2024
2.1.64 255 11/13/2024
2.1.63 91 11/13/2024
2.1.62 100 11/13/2024
2.1.61 71 11/13/2024
2.1.60 66 11/13/2024
2.1.59 210 11/13/2024
2.1.58 75 11/13/2024
2.1.57 75 11/13/2024
2.1.56 108 11/12/2024
2.1.55 71 11/12/2024
2.1.54 586 11/9/2024
2.1.53 103 11/9/2024
2.1.52 78 11/9/2024
2.1.51 123 11/9/2024
2.1.50 81 11/9/2024
2.1.49 79 11/9/2024
2.1.48 80 11/9/2024
2.1.47 211 11/9/2024
2.1.46 196 11/8/2024
2.1.45 82 11/8/2024
2.1.44 88 11/8/2024
2.1.43 106 11/8/2024
2.1.42 84 11/8/2024
2.1.41 197 11/8/2024
2.1.40 82 11/8/2024
2.1.39 80 11/8/2024
2.1.38 173 11/8/2024
2.1.37 77 11/8/2024
2.1.36 236 11/6/2024
2.1.35 124 11/6/2024
2.1.34 262 11/1/2024
2.1.33 111 11/1/2024
2.1.32 81 11/1/2024
2.1.31 110 11/1/2024
2.1.30 140 11/1/2024
2.1.29 139 11/1/2024
2.1.28 83 11/1/2024
2.1.26 204 10/29/2024
2.1.25 73 10/29/2024
2.1.24 70 10/29/2024
2.1.23 83 10/29/2024
2.1.22 78 10/29/2024
2.1.21 72 10/29/2024
2.1.20 210 10/29/2024
2.1.19 180 10/29/2024
2.1.18 113 10/29/2024
2.1.17 78 10/29/2024
2.1.16 69 10/29/2024
2.1.15 195 10/28/2024
2.1.14 77 10/28/2024
2.1.13 73 10/28/2024
2.1.12 300 10/26/2024
2.1.11 75 10/26/2024
2.1.10 77 10/26/2024
2.1.9 70 10/26/2024
2.1.8 77 10/26/2024
2.1.7 75 10/26/2024
2.1.6 198 10/22/2024
2.1.5 77 10/22/2024
2.1.4 75 10/22/2024
2.1.3 78 10/22/2024
2.1.2 80 10/22/2024
2.1.1 81 10/22/2024