Pass large array to node child process

后端 未结 6 1268
予麋鹿
予麋鹿 2021-01-01 10:29

I have complex CPU intensive work I want to do on a large array. Ideally, I\'d like to pass this to the child process.

var spawn = require(\'child_process\'         


        
6条回答
  •  伪装坚强ぢ
    2021-01-01 10:59

    Use an in memory cache like https://github.com/ptarjan/node-cache, and let the parent process store the array contents with some key, the child process would retreive the contents through that key.

提交回复
热议问题