X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=examples%2Fjavascript%2FdynamicExample.js;h=33fdec970c6a9de20aa431f353d71c627bb80e71;hb=171a05e95076ece321ff2fa829f04f9b5127ea4f;hp=21fe9050ead512abecc90def3ccc61c6668db433;hpb=de2e7182cca6b34b000a09bf6d0ddcff4757db3a;p=poolifier.git diff --git a/examples/javascript/dynamicExample.js b/examples/javascript/dynamicExample.js index 21fe9050..33fdec97 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)) }