Killing node.js workers after function is done
问题 I'm a total node.js newbie who's just started tinkering with it. I have a piece of code that executes a function that processes strings on all cpu cores, and I wish to determine which worker completed the function first by it's id, and after that kill every worker (or just exit node). Here's the simplified code of my program: var cluster = require('cluster'), cpus = require("os").cpus().length, // 4 cores myArray = ["foo","bar","baz","qux"]; // 1 string per core if (cluster.isMaster) { for