X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=examples%2FyourWorker.js;h=4597f6485b0073f01854c8285213c5e27ed689fb;hb=e06dcd52623ecb8752e09c4d53b1840843406bf4;hp=701aa8cf4d59cf15cd7623b0b09f8cbb0cef8928;hpb=a3c8691eb5bd772a43746fd5860d54a786463039;p=poolifier.git diff --git a/examples/yourWorker.js b/examples/yourWorker.js index 701aa8cf..4597f648 100644 --- a/examples/yourWorker.js +++ b/examples/yourWorker.js @@ -1,5 +1,5 @@ 'use strict' -const { ThreadWorker } = require('../lib/workers') +const { ThreadWorker } = require('poolifier') function yourFunction (data) { for (let i = 0; i <= 1000; i++) { @@ -12,9 +12,4 @@ function yourFunction (data) { return { ok: 1 } } -class MyWorker extends ThreadWorker { - constructor () { - super(yourFunction) - } -} -module.exports = new MyWorker() +module.exports = new ThreadWorker(yourFunction)