Перейти до основного вмісту
🔒 Режим прев'ю. Перші 15 уроків Foundations — безкоштовні; цей — Pro. Запусти 7-денний trial щоб відкрити редактор, AI-підказки і решту курсу. Потрібна картка, скасування в Dashboard у будь-який момент.
Почати 7-денний trial →
⚡
← Курси
›
FastAPI Production
›
Модуль 1 · Основи FastAPI
›
Асинхронний, правильно
quiz
4 / 105
🇺🇦
UA
▼
↗
Поділитись
⋯
Ще
+75 XP
📋
Завдання
📖
Теорія
🤖
AI Допомога
Завдання
🌐 shown in RU
📝 **Питання:** Чому `requests.get(...)` всередині `async def` шкідливо? 💡 requests — синхронний.
🎯 Тест
Питання
📝 **Питання:** Чому `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
Відповісти
💬 Обговорення
Будьте першим — поставте запитання або поділіться порадою.
Увійдіть
щоб приєднатися до обговорення. Читання безкоштовне.
Завантаження обговорення…