X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=examples%2Fjavascript%2FdynamicExample.js;h=3428170929d49c05d6e2b0b794b875377e0a77a8;hb=dcbe4226bec6b3eab0fc327bde2c37d0e7effba6;hp=ad79ba20294135dfc4569f1795151ae24f8ea3fc;hpb=7a923e5bc16ae3524c51bedd70c65ce6cc556fdc;p=poolifier.git diff --git a/examples/javascript/dynamicExample.js b/examples/javascript/dynamicExample.js index ad79ba20..34281709 100644 --- a/examples/javascript/dynamicExample.js +++ b/examples/javascript/dynamicExample.js @@ -10,7 +10,7 @@ const pool = new DynamicThreadPool( availableParallelism(), './yourWorker.js', { - errorHandler: e => console.error(e), + errorHandler: (e) => console.error(e), onlineHandler: () => console.info('worker is online') } ) @@ -30,12 +30,12 @@ for (let i = 1; i <= iterations; i++) { .then(() => { resolved++ if (resolved === iterations) { - console.info('Time taken is ' + (performance.now() - start)) - console.info('The pool was full for ' + poolFull + ' times') - console.info('The pool was ready for ' + poolReady + ' times') - return console.info('The pool was busy for ' + poolBusy + ' times') + console.info(`Time taken is ${performance.now() - start}`) + console.info(`The pool was full for ${poolFull} times`) + console.info(`The pool was ready for ${poolReady} times`) + return console.info(`The pool was busy for ${poolBusy} times`) } return null }) - .catch(err => console.error(err)) + .catch((err) => console.error(err)) }