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