HostLoom.RateLimiting.HttpClient 0.20.0

dotnet add package HostLoom.RateLimiting.HttpClient --version 0.20.0
                    
NuGet\Install-Package HostLoom.RateLimiting.HttpClient -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.HttpClient" 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.HttpClient" Version="0.20.0" />
                    
Directory.Packages.props
<PackageReference Include="HostLoom.RateLimiting.HttpClient" />
                    
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.HttpClient --version 0.20.0
                    
#r "nuget: HostLoom.RateLimiting.HttpClient, 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.HttpClient@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.HttpClient&version=0.20.0
                    
Install as a Cake Addin
#tool nuget:?package=HostLoom.RateLimiting.HttpClient&version=0.20.0
                    
Install as a Cake Tool

HostLoom.RateLimiting.HttpClient

Outgoing HttpClient integration for HostLoom rate limiter profiles. The handler acquires one permit per physical HTTP attempt, supports bounded local waiting, and throws typed exceptions for local rejection or backend denial instead of manufacturing HTTP 429 responses.

builder.Services
    .AddHttpClient("catalog", client =>
        client.BaseAddress = new Uri("https://catalog.example"))
    .AddHostLoomRateLimit("catalog-api", options =>
    {
        options.MaxWait = TimeSpan.FromSeconds(2);
        options.QueueLimit = 32;
    });

Register the rate limiter after retry or hedging handlers so it sits closest to the network and charges every physical attempt. Register it before those handlers to charge only the logical request instead.

MaxWait includes store acquisition and local delay time. QueueLimit bounds callers in the wait loop for one handler pipeline; it is not a global queue and has no oldest-first or cross-instance FIFO guarantee. Both defaults are zero, which rejects immediately. A positive MaxWait requires a positive QueueLimit.

  • RateLimitExceededException reports local exhaustion and an optional RetryAfter.
  • RateLimiterUnavailableException reports a store failure when OnUnavailable is Deny.
  • Explicitly degraded admissions and ordinary responses, including a real downstream 429, proceed unchanged.
  • Handler disposal does not dispose the shared limiter.

RateLimitedHttpMessageHandler also has a public constructor for container-free composition.

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

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.20.0 64 10/31/2026