Preskoči na glavni sadržaj
🔒 Način pregleda. Prvih petnaest Foundations lekcija je besplatno; ova je Pro. Pokrenite 7-dnevni trial da otključate editor, AI savjete i ostatak programa. Kartica obavezna, otkažite bilo kada u Dashboard.
Pokreni 7-dnevni trial →
⚡
← Kolegiji
›
FastAPI Production
›
Modul 1 · Osnove FastAPI-ja
›
Async, ispravno
quiz
4 / 105
🇭🇷
HR
▼
↗
Podijeli
⋯
Više
+75 XP
📋
Zadatak
📖
Teorija
🤖
AI Pomoć
Zadatak
📝 **Pitanje:** Zašto je štetno pozivati `requests.get(...)` unutar `async def` rute? 📋 Odaberi točan odgovor. 💡 `requests` je sinkrona biblioteka.
🎯 Kviz
Pitanje
📝 **Pitanje:** Zašto je štetno pozivati `requests.get(...)` unutar `async def` rute? 📋 Odaberi točan odgovor. 💡 `requests` je sinkrona biblioteka.
A
Uvicorn raises `RuntimeError: blocking call in coroutine` and returns 500 to the caller before the request even reaches your handler
B
It blocks the entire event loop, stalling every concurrent request on the worker until the synchronous HTTP call returns
C
Pydantic refuses to serialize the `requests.Response` object and the route returns a 422 even when the upstream call succeeded
D
FastAPI silently wraps the call in a threadpool, paying double overhead for what should be a single awaited coroutine
Odgovori
💬 Rasprava
Budi prvi — postavi pitanje ili podijeli savjet.
Prijavi se
kako bi se pridružio raspravi. Čitanje je besplatno.
Učitavanje rasprave…