|
|
|
|
|
by amelius
4084 days ago
|
|
Thanks for your comments. Some remarks here. 1. Node.js is a tool for building servers. On a server you generally cannot afford to have the event loop blocked by a computational intensive task. You need threads. 2. It would only require a "promise" to make the module-loading asynchronous. Leaving that out is not what I would call "quite a bit of a simplification", especially if using asynchronous callbacks is the "modus operandi" of programming on the Node.js platform itself. 3. Okay, I stand corrected. I remember that I waded through the documentation quite a bit though, trying to figure this out. |
|
You are not supposed to use your main event loop for computational intensive tasks.
Offload those tasks to separate workers and use queues.
That's node's basic knowledge. Its a trade off that you're supposed to be aware of when using node.