Whats the best way to handle an heavy process without blocking the event loop? Example: converting an image or big DB query.Is it best to require a thread for that? Like https://nodejs.org/api/cluster.html ?I've also read about manually spin off child processes using Node's child-process API functions. This one is nice because supports sending messages and objects between processes easily in a worker-like way and calculations wouldn't even have to be javascript. The child process running the calculations could even be C or something ..Wich one is better? Theres is any other better way?
Submitted January 12, 2019 at 09:55AM by Don-g9
No comments:
Post a Comment