HostLoom.RateLimiting.DependencyInjection 0.20.0

dotnet add package HostLoom.RateLimiting.DependencyInjection --version 0.20.0
                    
NuGet\Install-Package HostLoom.RateLimiting.DependencyInjection -Version 0.20.0
                    
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="HostLoom.RateLimiting.DependencyInjection" Version="0.20.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="HostLoom.RateLimiting.DependencyInjection" Version="0.20.0" />
                    
Directory.Packages.props
<PackageReference Include="HostLoom.RateLimiting.DependencyInjection" />
                    
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 HostLoom.RateLimiting.DependencyInjection --version 0.20.0
                    
#r "nuget: HostLoom.RateLimiting.DependencyInjection, 0.20.0"
                    
#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.
#:package HostLoom.RateLimiting.DependencyInjection@0.20.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=HostLoom.RateLimiting.DependencyInjection&version=0.20.0
                    
Install as a Cake Addin
#tool nuget:?package=HostLoom.RateLimiting.DependencyInjection&version=0.20.0
                    
Install as a Cake Tool

HostLoom.RateLimiting.DependencyInjection

Registers default and named RateLimiter profiles, backend stores, options validation, and readiness checks for HostLoom rate limiting.

builder.Services
    .AddHostLoomRateLimiting("catalog-api", options =>
    {
        options.Namespace = "catalog";
        options.TokenBucket = new TokenBucketRateLimitPolicy
        {
            TokenLimit = 100,
            TokensPerPeriod = 100,
            ReplenishmentPeriod = TimeSpan.FromSeconds(1),
        };
    })
    .UseRedis()
    .AddHealthChecks();

Use UseInMemory() for process-local operation, UseRedis() from HostLoom.Redis, or UseValkey() from HostLoom.Valkey. Each profile selects exactly one store. Redis or Valkey uses the same named connection as caching and locking when the profile and backend match; different profiles isolate their connections. Readiness uses the backend probe when available and never changes liveness.

Resolve the default limiter as RateLimiter, or a named limiter with GetRequiredKeyedService<RateLimiter>("catalog-api"). DistributedRateLimiter is registered as a concrete service too. The container owns the limiter and store; an HTTP handler does not dispose them.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  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 (2)

Showing the top 2 NuGet packages that depend on HostLoom.RateLimiting.DependencyInjection:

Package Downloads
HostLoom.Redis

Redis backend for HostLoom caching, locking, and rate limiting over shared connections and StackExchange.Redis.

HostLoom.Valkey

Standalone Valkey backend for HostLoom caching, coordination locks, and token-bucket rate limiting over ValkeyDotNet.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.20.0 88 10/31/2026