X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;ds=sidebyside;f=examples%2FmultiFunctionExample.js;h=055f143fdafae8ee1eb82e65f161d0f69f6b2e4e;hb=af64732b38dfd3b66eeabf9d9a27d1b47319f58b;hp=31fd8809613f7e2b86783a53bb16e9972128743c;hpb=979e2251853435eb4c98d9452bbf787a16aa0266;p=poolifier.git diff --git a/examples/multiFunctionExample.js b/examples/multiFunctionExample.js index 31fd8809..055f143f 100644 --- a/examples/multiFunctionExample.js +++ b/examples/multiFunctionExample.js @@ -1,16 +1,16 @@ const { FixedThreadPool } = require('poolifier') const pool = new FixedThreadPool(15, './multiFunctionWorker.js', { errorHandler: e => console.error(e), - onlineHandler: () => console.log('worker is online') + onlineHandler: () => console.info('worker is online') }) pool - .execute({ functionName: 'fn0', input: 'hello' }) - .then(res => console.log(res)) + .execute({ text: 'hello' }, 'fn0') + .then(res => console.info(res)) .catch(err => console.error(err)) pool - .execute({ functionName: 'fn1', input: 'multiple functions' }) - .then(res => console.log(res)) + .execute({ text: 'multiple functions' }, 'fn1') + .then(res => console.info(res)) .catch(err => console.error(err)) setTimeout(pool.destroy(), 3000)