Skip to content

Instantly share code, notes, and snippets.

@profOnno
Created April 10, 2015 15:16
Show Gist options
  • Save profOnno/58dbfccf0e261af16ba7 to your computer and use it in GitHub Desktop.
Save profOnno/58dbfccf0e261af16ba7 to your computer and use it in GitHub Desktop.
#!/usr/local/bin/node
wt = require('webworker-threads');
fib=require('./fibo');
function doit(){
console.log('before fibo');
console.log('fibo 30:'+fib(30));
console.log('after fibo');
if(typeof self !== 'undefined'){self.close();}
}
//works
doit();
//doesn't work
worker=new wt.Worker(doit);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment