I have a 100mb object that I try to return with a GET request:
function doWork(req,res) {
// creates a big object on a child process, then returns this big object
res.json(bigObject); // <--- problem line
}
app.get('/dowork', doWork);
Even though I am creating this big object on a child process I need the main process to return it (b/c the child process doesn't have the res stream). I'm wondering what's the proper way to do this? Right now converting this big object to json is horking my server for a while. No-one can connect while it is doing this.