
asyncio.to_thread: Stop Freezing Your Event Loop
One blocking call inside an async function can freeze every coroutine on your event loop. This post shows how asyncio.to_thread hands that w...

One blocking call inside an async function can freeze every coroutine on your event loop. This post shows how asyncio.to_thread hands that w...

Async code runs on one thread and only helps when you're waiting on I/O. Learn how sequential awaits, blocking calls and CPU-bound work canc...

Calling a model 100 times one by one is painfully slow. This post explains I/O-bound versus CPU-bound work, the GIL, threads, processes, and...

I used Redis for years without knowing what happens after I type SET. So I built a small clone in Python: it speaks the Redis wire protocol,...

Most asyncio tutorials start with syntax. This one starts with the problem. Once you see why your program spends most of its time waiting, c...