Skip to content

Instantly share code, notes, and snippets.

@adambom
Created July 15, 2013 18:15
Show Gist options
  • Save adambom/6002124 to your computer and use it in GitHub Desktop.
Save adambom/6002124 to your computer and use it in GitHub Desktop.
Distributed computing api example
var s = new DistributedSession('my-identifier');
s.on('connection', function (err, conn) {
conn.Parallel(data).map(mapper).reduce(reducer).then(function (d) {
console.log(d);
});
});
// Open connection and find peers
s.open().requirePeers(data.length);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment