Skip to content
Advertisement

Tag: coroutine

“This event loop is already running” and other problems when integrating aiohttp examples in my own application

I read a lot of the aiohttp related blogs and examples. I think I understand them but when I try to integrate that “knowledge” into the structure of my own application there are some problems. Below is a minimal (not) working example representing this structure. I assume I have a grounded misunderstanding of how the structure of such a program

Non-blocking launching of concurrent coroutines in Python

I want to execute tasks asynchronously and concurrently. If task1 is running when task2 arrives, task2 is started right away, without waiting for task2 to complete. Also, I would like to avoid callbacks with the help of coroutines. Here’s a concurrent solution with callbacks: Its output: And here’s my effort to get rid of callbacks: Output: In this case initial

Advertisement