
Security News
Bun 1.2.19 Adds Isolated Installs for Better Monorepo Support
Bun 1.2.19 introduces isolated installs for smoother monorepo workflows, along with performance boosts, new tooling, and key compatibility fixes.
Soenneker.Utils.RateLimiting.Factory
Advanced tools
An async thread-safe singleton dictionary for Soenneker.Utils.RateLimiting.Executors, designed to manage the rate at which tasks are executed.
dotnet add package Soenneker.Utils.RateLimiting.Factory
IRateLimitingFactory
within DI (Program.cs
).public static async Task Main(string[] args)
{
...
builder.Services.AddRateLimitingFactoryAsSingleton();
}
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
});
}
}
}
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
FAQs
An async thread-safe singleton dictionary for Soenneker.Utils.RateLimiting.Executors, designed to manage the rate at which tasks are executed.
We found that soenneker.utils.ratelimiting.factory demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Bun 1.2.19 introduces isolated installs for smoother monorepo workflows, along with performance boosts, new tooling, and key compatibility fixes.
Security News
Popular npm packages like eslint-config-prettier were compromised after a phishing attack stole a maintainer’s token, spreading malicious updates.
Security News
/Research
A phishing attack targeted developers using a typosquatted npm domain (npnjs.com) to steal credentials via fake login pages - watch out for similar scams.