feat: support multiple functions per worker
[poolifier.git] / examples / multiFunctionExample.js
index 31fd8809613f7e2b86783a53bb16e9972128743c..213736ea037899024da9e9aab20213ebf518de40 100644 (file)
@@ -5,11 +5,11 @@ const pool = new FixedThreadPool(15, './multiFunctionWorker.js', {
 })
 
 pool
-  .execute({ functionName: 'fn0', input: 'hello' })
+  .execute({ text: 'hello' }, 'fn0')
   .then(res => console.log(res))
   .catch(err => console.error(err))
 pool
-  .execute({ functionName: 'fn1', input: 'multiple functions' })
+  .execute({ text: 'multiple functions' }, 'fn1')
   .then(res => console.log(res))
   .catch(err => console.error(err))