Skip to content

Commit

Permalink
add a resolveHost method
Browse files Browse the repository at this point in the history
  • Loading branch information
Raynos committed Aug 19, 2015
1 parent cf2c9d8 commit 1bb7a4b
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion ringpop-handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ RingpopHandler.prototype.handleRequest = function handleRequest(req, buildRes) {
);
}

var dest = self.ringpop.lookup(shardKey);
var dest = self.resolveHost(shardKey);
if (self.ringpop.whoami() === dest) {
return self.realHandler.handleRequest(req, buildRes);
}
Expand All @@ -102,6 +102,13 @@ RingpopHandler.prototype.handleRequest = function handleRequest(req, buildRes) {
outreq.createOutRequest(dest);
};

RingpopHandler.prototype.resolveHost =
function resolveHost(shardKey) {
var self = this;

return self.ringpop.lookup(shardKey);
};

RingpopHandler.prototype.register = function register(arg1, fn) {
var self = this;

Expand Down

0 comments on commit 1bb7a4b

Please sign in to comment.