projectrules.ai

fastapi-blocking-operations

FastAPIAsynchronousNon-blockingAPIPython

Description

Limits blocking operations in routes, favoring asynchronous and non-blocking flows.

Globs

**/routers/*.py
---
description: Limits blocking operations in routes, favoring asynchronous and non-blocking flows.
globs: **/routers/*.py
---

- Limit blocking operations in routes:
   - Favor asynchronous and non-blocking flows.
   - Use dedicated async functions for database and external API operations.
   - Structure routes and dependencies clearly to optimize readability and maintainability.