You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 13, 2024. It is now read-only.
constnapa=require('napajs');constzone=napa.zone.create('zone',{workers: NUMBER_OF_WORKERS});functionfibParallel(n){if(n<=1){returnn;}varp1=zone.execute('','fibParallel',[n-1]);varp2=zone.execute('','fibParallel',[n-2]);varp3=zone.execute('','fibParallel',[n-3]);varp4=zone.execute('','fibParallel',[n-4]);// Returning promise to avoid blocking each worker.returnPromise.all([p1,p2,p3,p4]).then(([result1,result2,result3,result4])=>{returnresult1.value+result2.value+result3.value+result4.value;});}zone.broadcast(` var napa = require("napajs"); var zone = napa.zone.get("zone");`);// Broadcast function declaration of 'fibonacci' to napa workers.zone.broadcast(fibParallel.toString());constnum=awaitzone.execute('','fibParallel',[30]);console.log(num)
@SwenChan did you find any solution for that? , I know it's almost 3years back you posted this, but I hope you have some information, As i need a multi-thread feature in my nodejs application, Trying different available ways to fix.. My Node version 10.16.3
@SwenChan did you find any solution for that? , I know it's almost 3years back you posted this, but I hope you have some information, As i need a multi-thread feature in my nodejs application, Trying different available ways to fix.. My Node version 10.16.3
sorry pal, i have no solution yet. And i don't event know that this project is still maintained by somebody =)
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
environment: macos 10.13.5
node: 10.6.0
napajs: 0.2.3
code
And it throw
Anyone who can help me with this?
The text was updated successfully, but these errors were encountered: