Erik Marsja: How to Handle Coroutines with asyncio in Python

The post How to Handle Coroutines with asyncio in Python appeared first on Erik Marsja. When a program becomes very long and complex, it is convenient to divide it into subroutines, each of which implements a specific task. However, subroutines cannot be executed independently, but only at the request of the main program, which is responsible for coordinating the use of subroutines. In this post, we introduce a generalization of the concept of subroutines, known as coroutines: just like subroutines, coroutines compute a single computational step, but unlike subroutines, there…

Read More

I don’t understand Python’s Asyncio

Recently I started looking into Python’s new asyncio module a bit more. The reason for this is that I needed to do something that works better with evented IO and I figured I might give the new hot thing in the Python world a try. Primarily what I learned from this exercise is that I it’s a much more complex system than I expected and I am now at the point where I am very confident that I do not know how to use it properly. It’s not conceptionally hard…

Read More