Hacker News new | past | comments | ask | show | jobs | submit login

It's not? Try this - create 10 Postrges queries and run them in sequence with standard Python.

Now yield all those calls asynchronously as an array. What is this even about?




It's not about that. It's about 10 different clients all having their connections handled at the same time. There exist mechanisms to do that without async, and this post demonstrates that often they give better results.

If one connection needs to do a lot of work (your 10 queries), then that's a different (also important) problem to solve. Async is a nice (from a programmer point of view) way of doing it.


Now run them in 10 pythons using multi-proc. Now run then in 10 python threads.


Except that multi-threaded applications are inherently more complex and are extremely challenging to debug.


Multi-threading is only hard if you share state. Keep state separate and life is good.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: