Skip to content

Instantly share code, notes, and snippets.

@suma
Last active August 29, 2015 14:00
Show Gist options
  • Save suma/11203477 to your computer and use it in GitHub Desktop.
Save suma/11203477 to your computer and use it in GitHub Desktop.
Jubatus push-pull mixer (C++ 風な疑似言語)
// push-pull mixer
for (candidate in candidates) {
// pull from candidate
vector<bytes> my_args = self->get_pull_argument(0);
vector<bytes> candidate_diff = caondadate->pull(my_args);
// pull from me (myself)
vector<bytes> candidate_args = candidate->get_pull_argument();
vector<bytes> my_diff = self->pull(candidate_args);
// push to candidate/myself
candidate->push(my_diff);
self->push(candidate_diff);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment