-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Closed
Labels
api-approvedAPI was approved in API review, it can be implementedAPI was approved in API review, it can be implementedarea-System.Threadingin-prThere is an active PR which will close this issue when it is mergedThere is an active PR which will close this issue when it is merged
Milestone
Description
Background and motivation
It would be nice to be able to AND (and possibly OR) rate limiters together.
For example, "I want a rate limiter that allows no more than 10 requests per second and no more than 2 concurrent requsts".
API Proposal
namespace System.Threading.RateLimiting;
public class AggregateRateLimiter : RateLimiter
{
public AggregateRateLimiter(IEnumerable<RateLimiter> Children);
}API Usage
var Limiter1 = ...;
var Limiter2 = ...;
var Limiter = new AggregateRateLimiter([Limit1, Limit2]);Alternative Designs
People can always roll their own.
Risks
None that I can think of.
AoshiW, SbiCA, saithis and Jonah-Jordan
Metadata
Metadata
Assignees
Labels
api-approvedAPI was approved in API review, it can be implementedAPI was approved in API review, it can be implementedarea-System.Threadingin-prThere is an active PR which will close this issue when it is mergedThere is an active PR which will close this issue when it is merged