Enhancing AsyncIO for Complex Applications
summary
Explains concrete fixes: use asyncio.run manages the loop (avoid get_event_loop and manual loop.close), schedule work with asyncio.create_task, and use Queue plus Locks/Events/Conditions for coordination; install OS handlers for SIGINT/SIGTERM/SIGHUP, cancel all tasks on shutdown and flush logs/metrics to Sentry so postmortems aren’t blind. Recommends aioconsole and aiomonitor-ng shows long-running tasks (runs in a separate thread, supports 3.10+). For blocking libraries, wrap calls in ThreadPoolExecutor and incrementally port hot paths.
AI-written summary · about
chapters (5)
- 0:00Introduction and setup
- 3:34Concurrency coordination basics
- 7:54Error handling in AsyncIO
- 18:55Debugging AsyncIO applications
- 23:54Q&A session
related talks
40mAdvanced asyncio: Solving Real-world Production Problems
32mAdvanced asyncio: Solving Real-World Production Problems
30mImproving debuggability of complex asyncio applications
31mA Really Gentle Introduction to Asyncio
23mPractical usage of asyncio
31mThinking Outside the GIL with AsyncIO and Multiprocessing
25mThe hitchhiker's guide to asyncio
30mLet's get you started with asynchronous programming
