builder.Services.AddRateLimiter(o =>
{
o.AddTokenBucketLimiter("token", y =>
{
y.TokenLimit = 100;
y.QueueProcessingOrder = System.Threading.RateLimiting.QueueProcessingOrder.OldestFirst;
y.QueueLimit = 5;
y.ReplenishmentPeriod = TimeSpan.FromSeconds(10);
y.TokensPerPeriod = 20;
y.AutoReplenishment = true;
});
});
Source: https://twitter.com/mjovanovictech/status/1676185657092317187
Nenhum comentário :
Postar um comentário