Code coverage report for lib/child.js

Statements: 100% (7 / 7)      Branches: 100% (0 / 0)      Functions: 100% (2 / 2)      Lines: 100% (7 / 7)      Ignored: none     

All files » lib/ » child.js
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 241               1 1 1           1 1         1  
var Worker = require('./worker');
 
/**
 * Create a worker and tell it to write a data file.
 *
 * @param {Object} message: message object from the master process
 * @param {Function} cb: callback function
 */
function worker(message, cb) {
  console.log('Start worker ' + message.workerId);
  new Worker(message.workerId).write(
    message.templates,
    message.genId,
    message.numSegments,
    message.outFile,
    function () {
      console.log('Finish worker ' + message.workerId);
      cb();
    }
  );
}
 
module.exports = worker;