|
|
|
|
|
by emilsedgh
4084 days ago
|
|
On a server you generally cannot afford to have the event loop blocked by a computational intensive task. 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. |
|
EDIT: I mean workers which run in a thread (as opposed to in a process). An example is given by the webworker-threads npm module. Threads allow one to structurally share large data-structures, so one does not have to serialize them when calling a worker (serializing large structures would block the main thread).