X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=examples%2FyourWorker.js;h=b2df8d19093527e0ca67a24f9f84589ab1207050;hb=23a6c28d3cc6edb778653a4d9d9a4d36f9a961c3;hp=3e59f3465db2269fbb4ed2827f3c048c6010a8b8;hpb=fd7ebd496ee8e1f95c6c1dc2af5153d73ec3daab;p=poolifier.git diff --git a/examples/yourWorker.js b/examples/yourWorker.js index 3e59f346..b2df8d19 100644 --- a/examples/yourWorker.js +++ b/examples/yourWorker.js @@ -1,17 +1,17 @@ 'use strict' -const { ThreadWorker } = require('poolifier') const { isMainThread } = require('worker_threads') +const { ThreadWorker } = require('poolifier') const debug = false -function yourFunction (data) { +function yourFunction () { for (let i = 0; i <= 1000; i++) { const o = { a: i } JSON.stringify(o) } - debug === true && console.log('This is the main thread ' + isMainThread) + debug === true && console.info('This is the main thread ' + isMainThread) return { ok: 1 } }