npm install node-worker-threads-pool --save Simple ExampleQuickly create a pool with static task:const { StaticPool } = require('node-worker-threads-pool'); const staticPool = new StaticPool({ size: 4, task: (n) => n + 1 }); staticPool.exec(1).then((result) => { console.log...
npm install node-worker-threads-pool --save Simple ExampleQuickly create a pool with static task:const { StaticPool } = require('node-worker-threads-pool'); const staticPool = new StaticPool({ size: 4, task: (n) => n + 1 }); staticPool.exec(1).then((result) => { console.log...
npm install node-worker-threads-pool --save Simple Example Quickly create a pool with static task: const{StaticPool}=require('node-worker-threads-pool');conststaticPool=newStaticPool({size:4,task:(n)=>n+1});staticPool.exec(1).then((result)=>{console.log('result from thread pool:',res...
npm install node-worker-threads-pool --save Simple ExampleQuickly create a pool with static task:const { StaticPool } = require('node-worker-threads-pool'); const staticPool = new StaticPool({ size: 4, task: (n) => n + 1 }); staticPool.exec(1).then((result) => { console.log...