Speeding Up I/O‑Bound Work in Python with async/await
Learn how async/await lets a single Python thread handle many network requests concurrently, with a concrete web‑scraping example and practical guidance on trade‑offs.
ReadMeFeed / Community knowledge
Real questions. Useful conversations. Find the people who know your stack.
Learn how async/await lets a single Python thread handle many network requests concurrently, with a concrete web‑scraping example and practical guidance on trade‑offs.
A practical task guide for running I/O-bound work concurrently with Python asyncio: scheduling with create_task/gather, bounding with wait_for, offloading blocking calls, and clean shutdown with cancellation handling.
Learn how to set up SQLAlchemy 2.0’s AsyncEngine and AsyncSession for non‑blocking database access in FastAPI, including a working example, verification steps, and key limitations.
Python 3.11's asyncio.TaskGroup enforces structured concurrency: child tasks are awaited on exit, exceptions cancel siblings and re-raise as ExceptionGroup. Covers design, trust boundaries, failure modes, and when to use a supervised nursery instead.
SQLAlchemy 2.0’s async engine can cut latency for high‑concurrency workloads, but it adds complexity. This blog walks through the problem, setup, a worked example, trade‑offs, and actionable take‑aways for deciding whether to go async.
Learn how to implement a non-blocking database read/write path using SQLAlchemy 2.0 AsyncSession and QueuePool, including session lifecycle management and operational monitoring.
Discover when Python’s async/await is worth the extra complexity. A concrete aiohttp example shows real speedups for I/O‑bound tasks, plus a clear list of trade‑offs and actionable next steps.
Stop letting network latency freeze your Python apps. Learn how to use asyncio and aiohttp to handle concurrent I/O-bound tasks and increase application throughput.
A <py-script> that performs CPU-bound work or awaits a slow operation cannot be interrupted uniformly. When execution runs on the browser main thread, a synchronous Python loop freezes the page, and no documented timeout attribute on the tag reliably stops it. Moving execution into a Web Worker via the worker attribute or <py-worker> keeps the UI