Commit | Line | Data |
---|---|---|
57df5469 | 1 | 'use strict' |
be0676b3 | 2 | const { ClusterWorker } = require('../../../lib/index') |
57df5469 | 3 | |
106744f7 | 4 | function yourFunction (data) { |
6e9d10db | 5 | for (let i = 0; i < 1000; i++) { |
106744f7 | 6 | const o = { |
7 | a: i | |
8 | } | |
9 | JSON.stringify(o) | |
10 | } | |
ff5e76e1 | 11 | // console.log('This is the main thread ' + isMaster) |
106744f7 | 12 | return { ok: 1 } |
13 | } | |
14 | ||
325f50bc | 15 | module.exports = new ClusterWorker(yourFunction) |