draft: refactor project so it sits on top of a standalone app

This commit is contained in:
2020-05-11 15:34:47 +02:00
parent a9ee5acc1c
commit f97e8455fc
13068 changed files with 1735502 additions and 866 deletions
+5
View File
@@ -0,0 +1,5 @@
'use strict'
module.exports = function (inp, callback) {
callback(null, inp + ' BAR (' + process.pid + ')')
}
+13
View File
@@ -0,0 +1,13 @@
'use strict'
let workerFarm = require('../../')
, workers = workerFarm(require.resolve('./child'))
, ret = 0
for (let i = 0; i < 10; i++) {
workers('#' + i + ' FOO', function (err, outp) {
console.log(outp)
if (++ret == 10)
workerFarm.end(workers)
})
}