3 ms·
SO, basically you just learned about non-blocking and think node.js is a golden bullet. It's not. And it's exactly the same situation as anything they could ha
by dextorious 15y ago
SO, basically you just learned about non-blocking and think node.js is a golden bullet. It's not.
And it's exactly the same situation as anything they could have used in Python, as soon as they add actual code to get work done (as opposed to hand over work and wait for a callback).
"""The reason why I like node.js is that everything is built in a non-blocking way. Twisted has the same philosophy until people think they can get away using a blocking library inside the IO loop."""
That's not what they were doing, though. At the end of the non-blocking fiesta you want to actually return results to a waiting connection -- actual results, rendered templates etc. That will block and take time -- especially in node.js which is single threaded.
So they just traded Python's threads/processes/lightweight threads for node.js processes.
- taf2 15y agoSingle threaded, but small enough processes that multiple processes in node makes up for it. http://nodejs.org/docs/latest/api/child_processes.html http://nodejs.org/docs/latest/api/child_processes.html build a process pool and queue jobs to background processes, it's the same arch, you'd use if you had threads so what's your point?
- amix 15y agoNo, I did not learn about non-blocking approach recently. I have built solutions in Java and in node that scaled to over 300.000 open connections pocessing billions of messages. Besides that you are missing my point, which basically is to not mix blocking with non-blocking code.