Ensure we always clean up resources in ut. (#214)
[poolifier.git] / benchmarks / external / workerpoolWorker.js
CommitLineData
583a27ce 1const workerpool = require('workerpool')
57df5469 2
106744f7 3function yourFunction (data) {
4 for (let i = 0; i <= 1000; i++) {
5 const o = {
6 a: i
7 }
8 JSON.stringify(o)
9 }
10 // console.log('This is the main thread ' + isMainThread)
11 return { ok: 1 }
12}
13
583a27ce
JB
14workerpool.worker({
15 yourFunction: yourFunction
16})