Bump mocha from 8.3.0 to 8.3.1 (#254)
[poolifier.git] / examples / yourWorker.js
CommitLineData
27006a3d 1'use strict'
60fbd6d6 2const { ThreadWorker } = require('poolifier')
27006a3d 3
106744f7 4function yourFunction (data) {
5 for (let i = 0; i <= 1000; i++) {
6 const o = {
7 a: i
8 }
9 JSON.stringify(o)
10 }
11 // console.log('This is the main thread ' + isMainThread)
12 return { ok: 1 }
13}
14
1f9a5a44 15module.exports = new ThreadWorker(yourFunction)