Added prettier standard to support prettier and use it in combination with standard
[poolifier.git] / examples / multiFunctionExample.js
1 const FixedThreadPool = require('../lib/fixed')
2 const pool = new FixedThreadPool(15, './multifunctionWorker.js', {
3 errorHandler: e => console.error(e),
4 onlineHandler: () => console.log('worker is online')
5 })
6
7 pool.execute({ fname: 'fn0', input: 'hello' }).then(res => console.log(res))
8 pool
9 .execute({ fname: 'fn1', input: 'multifunction' })
10 .then(res => console.log(res))
11
12 setTimeout(pool.destroy.bind(pool), 3000)