Прескочи на главни садржај
🔒 Режим прегледа. Првих петнаест Foundations лекција је бесплатно; ова је Pro. Покрените 7-дневни trial да откључате едитор, AI савете и остатак курса. Картица је обавезна, можете отказати у било ком тренутку у Dashboard.
Покрени 7-дневни trial →
⚡
← Kursevi
›
FastAPI Production
›
Модул 1 · Основе ФастАПИ
›
Асинц, исправно
quiz
4 / 105
🇷🇸
SR
▼
↗
Подели
⋯
Више
+75 XP
📋
Zadatak
📖
Teorija
🤖
AI Pomoć
Zadatak
📝 **Питање:** Зашто је штетно позивати `requests.get(...)` унутар `async def` руте? 📋 Изабери тачан одговор. 💡 `requests` је синхрона библиотека.
🎯 Kviz
Pitanje
📝 **Питање:** Зашто је штетно позивати `requests.get(...)` унутар `async def` руте? 📋 Изабери тачан одговор. 💡 `requests` је синхрона библиотека.
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
💬 Diskusija
Budi prvi — postavi pitanje ili podeli savet.
Prijavi se
da bi se pridružio diskusiji. Čitanje je besplatno.
Učitavanje diskusije…