Created
July 15, 2013 18:15
-
-
Save adambom/6002124 to your computer and use it in GitHub Desktop.
Distributed computing api example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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