Module 11 Summary
What this module established
Background tasks are best-effort, in-process and not retried - use them only where losing the work is acceptable. Must-happen work needs a queue; must-happen-before-responding stays inline.
Carry forward
- Reject uploads on declared type first, then enforce size while reading. Checking afterwards means you already accepted the file.
- Never make a blocking call inside
async def. If the library has no async client, declare the handlerdef. - Streaming keeps memory flat and commits the status code before the body, so validate up front and signal truncation.
Before moving on
Move on when no blocking call remains in an async handler and every piece of deferred work is classified with a destination.
