import pambda from 'pambdajs';
const p = await pambda.init(5);
data = [1,2,3];
const heavyWork = (x) => {
return x+x;
}
// original single process way
const singleProcess = () => {
data.map(heavyWork);
}
// PambdaJS multi process way
const pambdaProcess = async () => {
await p.map(heavyWork, cb);
}
1
way2explore2 OP |