[Groonga-commit] groonga/express-kotoumi [master] Register event listener for backend events to the connection with the command name, not a common name "publish"

Back to archive index

YUKI Hiroshi null+****@clear*****
Thu Feb 7 18:30:59 JST 2013


YUKI Hiroshi	2013-02-07 18:30:59 +0900 (Thu, 07 Feb 2013)

  New Revision: 925ccb4fd7f147206f86b9fdddd4a251b318c5d6
  https://github.com/groonga/express-kotoumi/commit/925ccb4fd7f147206f86b9fdddd4a251b318c5d6

  Log:
    Register event listener for backend events to the connection with the command name, not a common name "publish"

  Modified files:
    lib/frontend/socket.io-adaptor.js
    test/frontend-socket.io-adaptor.test.js

  Modified: lib/frontend/socket.io-adaptor.js (+1 -1)
===================================================================
--- lib/frontend/socket.io-adaptor.js    2013-02-07 18:19:23 +0900 (ae85261)
+++ lib/frontend/socket.io-adaptor.js    2013-02-07 18:30:59 +0900 (a619999)
@@ -118,7 +118,7 @@ exports.register = function(application, server, params) {
 
       if (model.isA(command.definition, model.PublishSubscribe)) {
         var publishedMessageHandler = createPublishedMessageHandler(socket);
-        connection.on('publish', publishedMessageHandler);
+        connection.on(command.name, publishedMessageHandler);
       }
     });
 

  Modified: test/frontend-socket.io-adaptor.test.js (+1 -1)
===================================================================
--- test/frontend-socket.io-adaptor.test.js    2013-02-07 18:19:23 +0900 (513c4b5)
+++ test/frontend-socket.io-adaptor.test.js    2013-02-07 18:30:59 +0900 (a629df8)
@@ -156,7 +156,7 @@ suite('Socket.IO API', function() {
   });
 
   test('back to front', function(done) {
-    connection = utils.createMockedBackendConnection(utils.socketIoDefaultCommandsModule);
+    connection = utils.createMockedBackendConnection(testPlugin);
 
     var clientReceiver = nodemock
           .mock('receive')
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index