Last active
March 6, 2020 18:26
-
-
Save matthewstokeley/0f354ff01a21716c656a76845e0d6772 to your computer and use it in GitHub Desktop.
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
// RDD-inspired replication with node | |
const createQueue (nodeServices) => { | |
const q = new Set() | |
for (var value of nodeServices) { | |
q.add(value) | |
} | |
return q; | |
} | |
let queue = createQueue(nodeService); | |
// ... | |
events.on('accumulator request', data, function() { | |
var nodeWorker = queue.next, | |
// run the function and store the data | |
// in this service | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment