3 ms·
os.cpus().forEach(cluster.fork) Should be: os.cpus().forEach(cluster.fork.bind(cluster));
by MatthewPhillips 14y ago
os.cpus().forEach(cluster.fork)
Should be:
os.cpus().forEach(cluster.fork.bind(cluster));
- ricardobeat 14y agoThat's not needed. The API is designed so that you can do var fork = require('cluster').fork Cluster methods keep a reference to the main object inside the module, see https://github.com/joyent/node/blob/master/lib/cluster.js#L466 https://github.com/joyent/node/blob/master/lib/cluster.js#L4...