X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=examples%2FmultiFunctionExample.js;h=213736ea037899024da9e9aab20213ebf518de40;hb=dab8c377b70fc962ec217f2aeb719842f9f94cd6;hp=0c4b749e6bbdabc5d542de614e47706a22ab7f09;hpb=583a27ce13d67cc33ded52f46fe1665c64a8fec7;p=poolifier.git diff --git a/examples/multiFunctionExample.js b/examples/multiFunctionExample.js index 0c4b749e..213736ea 100644 --- a/examples/multiFunctionExample.js +++ b/examples/multiFunctionExample.js @@ -1,16 +1,16 @@ const { FixedThreadPool } = require('poolifier') -const pool = new FixedThreadPool(15, './multifunctionWorker.js', { +const pool = new FixedThreadPool(15, './multiFunctionWorker.js', { errorHandler: e => console.error(e), onlineHandler: () => console.log('worker is online') }) pool - .execute({ fname: 'fn0', input: 'hello' }) + .execute({ text: 'hello' }, 'fn0') .then(res => console.log(res)) .catch(err => console.error(err)) pool - .execute({ fname: 'fn1', input: 'multifunction' }) + .execute({ text: 'multiple functions' }, 'fn1') .then(res => console.log(res)) .catch(err => console.error(err)) -setTimeout(pool.destroy.bind(pool), 3000) +setTimeout(pool.destroy(), 3000)