This ejercicio is from WorkForFood.
Propose solution how we can restrict the number of requests for our web APIs.
- C#
- .NET 6.0
Yes, there is [RateLimiting]https://learn.microsoft.com/en-us/aspnet/core/performance/rate-limit?view=aspnetcore-8.0 But as for it should be custom and .net 6.0 base idea comes from here and there Integration Tests from here and there so...
with RequestThrottlingMiddleware
- limits the number of requests handled in parallel
- use queue for processing boost
- queue is limited by length and has item timeout
Just run tests
.net core
c#
asp.net core
web api
minimal api
xUnit
integration test
mvc testing
webapplicationfactory
testhost
middleware
limited concurrent queue
slim semaphore
interlocked