[Groonga-commit] droonga/express-droonga at a2d5d7a [master] Run callback function for wrappedconnection.emit() without envelope

Back to archive index

YUKI Hiroshi null+****@clear*****
Thu Sep 5 14:27:56 JST 2013


YUKI Hiroshi	2013-09-05 14:27:56 +0900 (Thu, 05 Sep 2013)

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

  Message:
    Run callback function for wrappedconnection.emit() without envelope

  Modified files:
    lib/adapter/wrapper.js

  Modified: lib/adapter/wrapper.js (+9 -1)
===================================================================
--- lib/adapter/wrapper.js    2013-09-05 11:16:56 +0900 (49e2ee2)
+++ lib/adapter/wrapper.js    2013-09-05 14:27:56 +0900 (d115437)
@@ -5,7 +5,15 @@ function DroongaProtocolConnectionWrapper(connection, callback, options) {
 }
 DroongaProtocolConnectionWrapper.prototype = {
   emit: function(event, data, callback) {
-    this._connection.emitMessage(event, data, callback || this._callback, this._options);
+    if (callback) {
+      var originalCallback = callback;
+      callback = function(error, response) {
+        originalCallback(error, response.body);
+      };
+    } else {
+      callback = this._callback;
+    }
+    this._connection.emitMessage(event, data, callback, this._options);
   },
   destroy: function() {
     delete this._connection;
-------------- next part --------------
HTML����������������������������...
Download 



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