ffb72c2969a0e6845801efa003b3e8c2dfc4fbce
[poolifier.git] / yourWorker.js
1 'use strict'
2 const ThreadWorker = require('./worker')
3 const { isMainThread } = require('worker_threads')
4
5 class MyWorker extends ThreadWorker {
6 constructor () {
7 super((data) => {
8 // console.log('This is the main thread ' + isMainThread)
9 // this.parent.postMessage(JSON.stringify(data))
10 return JSON.stringify(data)
11 })
12 }
13 }
14
15 module.exports = new MyWorker()