Friday 19 May 2017

Sending large objects to node child process

I've been trying for 2 days to send data to a node child process. I tried this:

var cp = require('child_process');
var child = cp.fork('/getStatistics.js');

// dataAsNumbers is a 2D array
child.send({ 
    dataAsNumbers: dataAsNumbers
});

This works with dataAsNumbers length is 10,000. However, when it's 800,000 in length, Node hangs. I guess this there is a limit for the .send method.

I've done loads of research and I cannot figure out this: how do you send large objects to a node child process?



via Mark

No comments:

Post a Comment