ASGI in depth
summary
Explains ASGI internals: the scope/receive/send callable signature, concrete event names like http.response.start and http.response.body with the more_body flag, and lifespan startup/shutdown events. Examines implementations—uvicorn internals and Starlette’s response (which itself implements ASGI)—showing how sync view functions use run_in_executor and asgiref helpers, how middleware wraps send/receive, and why header timing is tricky. Includes performance comparisons (uvicorn ≈100% vs hypercorn ≈91%) and practical pitfalls to watch for.
AI-written summary · about
chapters (15)
- 0:00Introduction
- 1:07ASGI history and motivation
- 6:29Async Python issues
- 8:58Python threading and GIL
- 11:48Async/await libraries boom
- 14:19ASGI emergence and specs
- 17:37ASGI vs WSGI in Django/Flask
- 23:02Metal Gear in ASGI
- 26:11Uvicorn internals
- 33:04ASGI app structure and launch
- 36:15Sync/async handling in ASGI
- 39:10asgiref features
- 40:16Django ASGI support
- 43:59Django ASGI migration issues
- 45:42Summary and resources
related talks
31mInside ASGI The Engine Behind Modern Python Web Frameworks
26mInside web framework: intro to the ASGI spec, middleware and apps
18mFrom WSGI to ASGI - Django 3.0
31mFastAPI Internals - How does it work?
32mSync vs. Async in Python: Tools, Benchmarks, and ASGI/WSGI Explained
31mHey, Python-Web-Community! What's going on?
01h 01mThe Unsung Hero of Modern Software: Asynchronous Messaging
01h 10mJust Add Await: Retrofitting Async Into Django
