3 ms·
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 th
by papito 6y ago
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?
- brianwawok 6y agoNow run them in 10 pythons using multi-proc. Now run then in 10 python threads.
- papito 6y agoExcept that multi-threaded applications are inherently more complex and are extremely challenging to debug.
- brianwawok 6y agoMulti-threading is only hard if you share state. Keep state separate and life is good.
- rkangel 6y agoIt'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.