build(deps-dev): bump @types/node
[poolifier.git] / examples / javascript / multiFunctionExample.js
index addbf46c7452b6e01676a24b9e9e165a316b1e4b..9667be3d090d0ba3c735af22d2afc4fb69ca0854 100644 (file)
@@ -5,18 +5,18 @@ const pool = new FixedThreadPool(
   availableParallelism(),
   './multiFunctionWorker.js',
   {
-    errorHandler: (e) => console.error(e),
+    errorHandler: e => console.error(e),
     onlineHandler: () => console.info('worker is online')
   }
 )
 
 pool
   .execute({ text: 'hello' }, 'fn0')
-  .then((res) => console.info(res))
-  .catch((err) => console.error(err))
+  .then(res => console.info(res))
+  .catch(err => console.error(err))
 pool
   .execute({ text: 'multiple functions' }, 'fn1')
-  .then((res) => console.info(res))
-  .catch((err) => console.error(err))
+  .then(res => console.info(res))
+  .catch(err => console.error(err))
 
-setTimeout(pool.destroy(), 3000)
+setTimeout(async () => await pool.destroy(), 3000)