Skip to content

Commit

Permalink
Address Ben's PR feedback; rename handler functions for easier debugg…
Browse files Browse the repository at this point in the history
…ability
  • Loading branch information
jwolski committed Aug 26, 2015
1 parent a20ae4f commit 0ccffcc
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 18 deletions.
4 changes: 2 additions & 2 deletions server/admin/debug-clear.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
// THE SOFTWARE.
'use strict';

module.exports = function createHandler(ringpop) {
return function handle(arg1, arg2, hostInfo, callback) {
module.exports = function createDebugClearHandler(ringpop) {
return function handleDebugClear(arg1, arg2, hostInfo, callback) {
ringpop.clearDebugFlags();
callback(null, null, 'ok');
};
Expand Down
4 changes: 2 additions & 2 deletions server/admin/debug-set.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@

var safeParse = require('../../lib/util.js').safeParse;

module.exports = function createHandler(ringpop) {
return function handle(arg1, arg2, hostInfo, callback) {
module.exports = function createDebugSetHandler(ringpop) {
return function handleDebugSet(arg1, arg2, hostInfo, callback) {
var body = safeParse(arg2.toString());
if (body && body.debugFlag) {
ringpop.setDebugFlag(body.debugFlag);
Expand Down
4 changes: 2 additions & 2 deletions server/admin/gossip.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
// THE SOFTWARE.
'use strict';

module.exports = function createHandler(ringpop) {
return function handle(arg1, arg2, hostInfo, callback) {
module.exports = function createGossipHandler(ringpop) {
return function handleGossip(arg1, arg2, hostInfo, callback) {
ringpop.gossip.start();
callback(null, null, 'ok');
};
Expand Down
4 changes: 2 additions & 2 deletions server/admin/join.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
var errors = require('../../lib/errors.js');
var sendJoin = require('../../lib/swim/join-sender.js').joinCluster;

module.exports = function createHandler(ringpop) {
return function handle(arg1, arg2, hostInfo, callback) {
module.exports = function createJoinHandler(ringpop) {
return function handleJoin(arg1, arg2, hostInfo, callback) {
if (!ringpop.membership.localMember) {
process.nextTick(function() {
callback(errors.InvalidLocalMemberError());
Expand Down
4 changes: 2 additions & 2 deletions server/admin/leave.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ var RedundantLeaveError = TypedError({
message: 'A node cannot leave its cluster when it has already left.'
});

module.exports = function createHandler(ringpop) {
return function handle(arg1, arg2, hostInfo, callback) {
module.exports = function createLeaveHandler(ringpop) {
return function handleLeave(arg1, arg2, hostInfo, callback) {
if (typeof callback !== 'function') {
callback = function noop() {};
}
Expand Down
4 changes: 2 additions & 2 deletions server/admin/lookup.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
// THE SOFTWARE.
'use strict';

module.exports = function createHandler(ringpop) {
return function handle(arg1, arg2, hostInfo, callback) {
module.exports = function createLookupHandler(ringpop) {
return function handleLookup(arg1, arg2, hostInfo, callback) {
var key = arg2.toString();
callback(null, null, JSON.stringify({
dest: ringpop.lookup(key)
Expand Down
4 changes: 2 additions & 2 deletions server/admin/reload.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@

var safeParse = require('../../lib/util.js').safeParse;

module.exports = function createHandler(ringpop) {
return function handle(arg1, arg2, hostInfo, callback) {
module.exports = function createReloadHandler(ringpop) {
return function handleReload(arg1, arg2, hostInfo, callback) {
var body = safeParse(arg2.toString());
if (body && body.file) {
ringpop.reload(body.file, function(err) {
Expand Down
4 changes: 2 additions & 2 deletions server/admin/stats.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
// THE SOFTWARE.
'use strict';

module.exports = function createHandler(ringpop) {
return function handle(arg1, arg2, hostInfo, callback) {
module.exports = function createStatsHandler(ringpop) {
return function handleStats(arg1, arg2, hostInfo, callback) {
callback(null, null, JSON.stringify(ringpop.getStats()));
};
};
4 changes: 2 additions & 2 deletions server/admin/tick.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
// THE SOFTWARE.
'use strict';

module.exports = function createHandler(ringpop) {
return function handle(arg1, arg2, hostInfo, callback) {
module.exports = function createTickHandler(ringpop) {
return function handleTick(arg1, arg2, hostInfo, callback) {
ringpop.handleTick(function onTick(err, resp) {
callback(err, null, JSON.stringify(resp));
});
Expand Down

0 comments on commit 0ccffcc

Please sign in to comment.