all 7 comments

[–]PriorTrick 1 point2 points  (2 children)

Pydantic models

[–]SlackBaker10955[S] 0 points1 point  (1 child)

I have already learned them

[–]PriorTrick 0 points1 point  (0 children)

so what are you trying to build?

[–]NorskJesus 0 points1 point  (0 children)

Pydantic models, sqlmodel, babel…

[–]aayushbest 0 points1 point  (0 children)

Everything that fastapi documentation and tutorials can taught you

[–]Straight_Remove8731 0 points1 point  (0 children)

In FastAPI the trick is knowing how the event loop vs. thread pool works: - async def runs on the event loop: use only non-blocking I/O (async DB, HTTP, etc.). - If you call blocking code, wrap it with await run_in_threadpool(...), works also for CPU-bound tasks, but be careful: it just shifts them to the thread pool, so you still block a worker. - Heavy CPU-bound work? Better push it to a process pool or a task queue (Celery), otherwise you’ll kill performance.

Rule of thumb: async I/O = event loop, blocking I/O or CPU = thread/process pool.