You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

13 lines
287 B

4 years ago
  1. 'use strict'
  2. let workerFarm = require('../../')
  3. , workers = workerFarm(require.resolve('./child'))
  4. , ret = 0
  5. for (let i = 0; i < 10; i++) {
  6. workers('#' + i + ' FOO', function (err, outp) {
  7. console.log(outp)
  8. if (++ret == 10)
  9. workerFarm.end(workers)
  10. })
  11. }