DEV Community

Discussion on: How to create a streaming HTTP interface in Python?

Collapse
 
anoff profile image
Andreas Offenhaeuser

Wow thanks for this amazing response! I will take a deeper look at aiohttp. But wrapping my code into a generator would also be a valid fallback.

Maybe I am just too spoiled by the way nodeJS handles streams that I have a hard time understanding why things are so difficult in the python world :)

Collapse
 
rhymes profile image
rhymes

If you're used to NodeJS I'm sure you'll fit in with aiohttp being async and all.

About the generator trick: I haven't tried with gunicorn and multiple processes. I feel like it's going to destroy the performance because each process might be able to serve only on request (the one generating the stream).

Can't wait to read your article on the solution ;)