CodeSkills
← 返回发现

FastAPI

Build fast, production-ready Python APIs with type hints, validation, and async support.

来自 GitHub查看原文 →2026-03-24

# FastAPI Patterns

## 异步 Traps - Mixing sync 数据库 drivers (psycopg2, PyMySQL) in 异步 endpoints blocks the 事件循环 — use 异步 drivers (asyncpg, aiomysql) or 运行 sync code in `run_in_executor` - `time.sleep()` in 异步 endpoints blocks everything — use `等待 asyncio.sleep()` instead - CPU-bound work in 异步 endpoi

相关 Skills