Error handling and unit tests
[poolifier.git] / examples / multiFunctionExample.js
CommitLineData
106744f7 1const FixedThreadPool = require('../lib/fixed')
2const pool = new FixedThreadPool(15,
3 './multifunctionWorker.js',
4 { errorHandler: (e) => console.error(e), onlineHandler: () => console.log('worker is online') })
5
6pool.execute({ fname: 'fn0', input: 'hello' }).then(res => console.log(res))
7pool.execute({ fname: 'fn1', input: 'multifunction' }).then(res => console.log(res))
8
9setTimeout(pool.destroy.bind(pool), 3000)