[Groonga-commit] droonga/express-droonga at 97cc83e [master] Shorten name of callback methods

Zurück zum Archiv-Index

YUKI Hiroshi null+****@clear*****
Thu Oct 17 15:37:41 JST 2013


YUKI Hiroshi	2013-10-17 15:37:41 +0900 (Thu, 17 Oct 2013)

  New Revision: 97cc83eacf3da5ae0ee34e079a5eddd6378f03fe
  https://github.com/droonga/express-droonga/commit/97cc83eacf3da5ae0ee34e079a5eddd6378f03fe

  Message:
    Shorten name of callback methods
    
    onSubscribeResponse =>
    onSubscribed
    onUnsubscribeResponse =>
    onUnsubscribed

  Modified files:
    lib/adapter/api/socket.io.js
    lib/adapter/command.js
    lib/adapter/socket.io.js
    test/adapter/socket.io.test.js

  Modified: lib/adapter/api/socket.io.js (+2 -2)
===================================================================
--- lib/adapter/api/socket.io.js    2013-10-17 12:45:47 +0900 (1e3fcc0)
+++ lib/adapter/api/socket.io.js    2013-10-17 15:37:41 +0900 (765e543)
@@ -11,7 +11,7 @@ module.exports = {
       data.route = /* data.route || */ connection.routeToSelf;
       connection.emit('watch.subscribe', data);
     },
-    onSubscribeResponse: function(data, socket) {
+    onSubscribed: function(data, socket) {
       socket.emit('watch.subscribe.response', data);
     },
     onUnsubscribe: function(data, connection) {
@@ -19,7 +19,7 @@ module.exports = {
       data.route = /* data.route || */ connection.routeToSelf;
       connection.emit('watch.unsubscribe', data);
     },
-    onUnsubscribeResponse: function(data, socket) {
+    onUnsubscribed: function(data, socket) {
       socket.emit('watch.unsubscribe.response', data);
     },
     onNotify: function(data, socket) {

  Modified: lib/adapter/command.js (+4 -4)
===================================================================
--- lib/adapter/command.js    2013-10-17 12:45:47 +0900 (028d57c)
+++ lib/adapter/command.js    2013-10-17 15:37:41 +0900 (90270d7)
@@ -48,14 +48,14 @@ util.inherits(PublishSubscribe, Command);
 Object.defineProperty(PublishSubscribe.prototype, 'onSubscribe', {
   get: function() { return this._options.onSubscribe; }
 });
-Object.defineProperty(PublishSubscribe.prototype, 'onSubscribeResponse', {
-  get: function() { return this._options.onSubscribeResponse; }
+Object.defineProperty(PublishSubscribe.prototype, 'onSubscribed', {
+  get: function() { return this._options.onSubscribed; }
 });
 Object.defineProperty(PublishSubscribe.prototype, 'onUnsubscribe', {
   get: function() { return this._options.onUnsubscribe; }
 });
-Object.defineProperty(PublishSubscribe.prototype, 'onUnsubscribeResponse', {
-  get: function() { return this._options.onUnsubscribeResponse; }
+Object.defineProperty(PublishSubscribe.prototype, 'onUnsubscribed', {
+  get: function() { return this._options.onUnsubscribed; }
 });
 Object.defineProperty(PublishSubscribe.prototype, 'onNotify', {
   get: function() { return this._options.onNotify; }

  Modified: lib/adapter/socket.io.js (+2 -2)
===================================================================
--- lib/adapter/socket.io.js    2013-10-17 12:45:47 +0900 (3204e01)
+++ lib/adapter/socket.io.js    2013-10-17 15:37:41 +0900 (ce3c0f3)
@@ -49,10 +49,10 @@ exports.register = function(application, server, params) {
       if (command.PublishSubscribe.isInstance(commandDefinition))  {
         if (/\.subscribe$/.test(commandName)) {
           requestHandler  = 'onSubscribe';
-          responseHandler = 'onSubscribeResponse';
+          responseHandler = 'onSubscribed';
         } else if (/\.unsubscribe$/.test(commandName)) {
           requestHandler  = 'onUnsubscribe';
-          responseHandler = 'onUnsubscribeResponse';
+          responseHandler = 'onUnsubscribed';
         }
       }
 

  Modified: test/adapter/socket.io.test.js (+4 -4)
===================================================================
--- test/adapter/socket.io.test.js    2013-10-17 12:45:47 +0900 (d489ae3)
+++ test/adapter/socket.io.test.js    2013-10-17 15:37:41 +0900 (5c6ee12)
@@ -39,13 +39,13 @@ suite('Socket.IO Adapter', function() {
       onSubscribe: function(data, connection) {
         connection.emit('pubsub-mod-event.mod.subscribe', data);
       },
-      onSubscribeResponse: function(data, socket) {
+      onSubscribed: function(data, socket) {
         socket.emit('pubsub-mod-event.mod.subscribe.response', data);
       },
       onUnsubscribe: function(data, connection) {
         connection.emit('pubsub-mod-event.mod.unsubscribe', data);
       },
-      onUnsubscribeResponse: function(data, socket) {
+      onUnsubscribed: function(data, socket) {
         socket.emit('pubsub-mod-event.mod.unsubscribe.response', data);
       },
       onNotify: function(data, socket) {
@@ -56,13 +56,13 @@ suite('Socket.IO Adapter', function() {
       onSubscribe: function(data, connection) {
         connection.emit('pubsub-mod-body.subscribe', 'modified request');
       },
-      onSubscribeResponse: function(data, socket) {
+      onSubscribed: function(data, socket) {
         socket.emit('pubsub-mod-body.subscribe.response', 'modified response');
       },
       onUnsubscribe: function(data, connection) {
         connection.emit('pubsub-mod-body.unsubscribe', 'modified request');
       },
-      onUnsubscribeResponse: function(data, socket) {
+      onUnsubscribed: function(data, socket) {
         socket.emit('pubsub-mod-body.unsubscribe.response', 'modified response');
       },
       onNotify: function(data, socket) {
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Zurück zum Archiv-Index