3 ms·
And that's why I love Node.js: the single-threaded concurrency (or should I say non-concurrency?) is built-in in the execution model. Building your architecture
by kaoD 14y ago
And that's why I love Node.js: the single-threaded concurrency (or should I say non-concurrency?) is built-in in the execution model. Building your architecture decoupled from the ground up is useful, and Node.js does a great job at it.
I found Redis is an awesome middleware for MQ purposes. Its builtin PubSub system, blocking POPs and amazing speed make it a perfect fit.
But beware: it's easy to get it wrong and make the system a tangled mess of messages. Just make sure the message dispatch overhead is worth it.
- fforw 14y agoIs node actually able to use more than one core now?
- DonPellegrino 14y agoIt has been able to for a while! Check out the cluster module, processes listening to the same port are load balanced and communication between processes is obviously (since each process only has 1 thread due to the event loop) done by message passing.
- kaoD 14y agoTechnically spakeaing: no, and it never will. Single-threading is by design, so the best bet is to run several processes, each using one core (see the other answer to your comment).