FastAPI funksionon mbi ASGI, ndaj një kërkesë kalon nëpër një pipeline asinkron: serveri ASGI e pranon, middleware e mbështjell, router-i përputh një path, dependencies zgjidhen, ekzekutohet path operation-i yt, dhe vlera e kthyer serializohet në përgjigje.
Fazat
uvicorn (ASGI server)
│ scope + receive/send
▼
ASGI / Starlette middleware ── (CORS, GZip, custom)
▼
Routing ── ërputh metodën + → operation
▼
Dependencies (Depends) ── zgjidh sub-deps, security, yield-setup
▼
operation function ── ekzekutohet handler- yt
▼
Response model ── validon + serializon në JSON
▼
tasks ── ekzekutohen pasi ërgjigja është dërguar
▼
Response ──▶ client
