Skip to course content
Free FastAPI backend course

FastAPI for AI Backend Development

Module 11 Activity

Scenario

Handle the work that does not fit inside a single fast request.

What you build

Correctly classified async work, safe uploads, no blocking in async handlers, and a streamed response.

Steps

  1. Classify every piece of deferred work as best-effort, must-happen, scheduled or inline, and route each accordingly.
  2. Build an upload endpoint that checks type first and enforces size while reading.
  3. Find any blocking call inside an async def handler and either await it properly or change the handler to def.
  4. Measure the difference under concurrency and report it.
  5. Build one streamed response and say how the client detects truncation.
  6. For anything that must happen, describe the queue and how status is reported back.

Evidence to hand in

Review checklist