Ensure we always clean up resources in ut. (#214)
[poolifier.git] / benchmarks / external / workerpoolWorker.js
1 const workerpool = require('workerpool')
2
3 function 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
14 workerpool.worker({
15 yourFunction: yourFunction
16 })