pub async fn processing_limit(
__arg0: State<&AppState>,
req: Request,
next: Next,
) -> Result<impl IntoResponse, Error>Expand description
Middleware that implements concurrent request processing limits
This middleware:
- Tracks number of concurrent requests being processed
- Enforces a maximum limit on concurrent requests
- Returns 429 Too Many Requests when limit is exceeded
- Properly decrements counter when request processing completes
ยงArguments
State(state)- Application state containing limit configurationreq- The incoming requestnext- The next middleware in the chain