[Groonga-commit] groonga/express-kotoumi [master] Export "connection.tag" for other modules

Back to archive index

YUKI Hiroshi null+****@clear*****
Mon Feb 4 11:53:53 JST 2013


YUKI Hiroshi	2013-02-04 11:53:53 +0900 (Mon, 04 Feb 2013)

  New Revision: 8f009928cca29a931212225867eeaabc9fbafe61
  https://github.com/groonga/express-kotoumi/commit/8f009928cca29a931212225867eeaabc9fbafe61

  Log:
    Export "connection.tag" for other modules

  Modified files:
    lib/backend/connection.js

  Modified: lib/backend/connection.js (+3 -3)
===================================================================
--- lib/backend/connection.js    2013-02-01 18:56:28 +0900 (c6d0a34)
+++ lib/backend/connection.js    2013-02-04 11:53:53 +0900 (bc53978)
@@ -40,6 +40,7 @@ Connection.prototype = new EventEmitter();
 
 Connection.prototype._init = function() {
   this._callbacks = {};
+  this.tag = this._params.tag || DEFAULT_FLUENT_TAG;
   this._initSender();
   this._initReceiver();
 };
@@ -47,8 +48,7 @@ Connection.prototype._init = function() {
 Connection.prototype._initSender = function(wait) {
   var options = { host: this._params.hostName || DEFAULT_FLUENT_HOST_NAME,
                   port: this._params.port || DEFAULT_FLUENT_PORT };
-  var sender = fluent.createFluentSender(this._params.tag || DEFAULT_FLUENT_TAG,
-                                         options);
+  var sender = fluent.createFluentSender(this.tag, options);
   this._sender = sender;
   this._sender.on('error', (function(error) {
     this.emit('error', error);
@@ -65,7 +65,7 @@ Connection.prototype._initReceiver = function() {
   }).bind(this));
 
   this._receiver = receiver;
-  this._receiver.on((this._params.tag || DEFAULT_FLUENT_TAG) + '.message',
+  this._receiver.on(this.tag + '.message',
                     this._handleMessage.bind(this));
 };
 
-------------- next part --------------
HTML����������������������������...
Download 



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