From 00dda23466313e9d9ca49ba1721a04cc1ed3fadd Mon Sep 17 00:00:00 2001 From: Ivan Etchart Date: Fri, 25 Nov 2016 10:48:53 -0600 Subject: [PATCH] Update Redis ascoltatori to use pub_conn instead of client_conn --- lib/redis_ascoltatore.js | 6 +++--- test/redis_ascoltatore_spec.js | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/redis_ascoltatore.js b/lib/redis_ascoltatore.js index 72241c0..6c72a12 100644 --- a/lib/redis_ascoltatore.js +++ b/lib/redis_ascoltatore.js @@ -82,7 +82,7 @@ RedisAscoltatore.prototype = Object.create(AbstractAscoltatore.prototype); RedisAscoltatore.prototype._startPub = function() { var that = this; if (this._client === undefined) { - this._client = createConn(this._opts, 'client_conn'); + this._client = createConn(this._opts, 'pub_conn'); this._client.on("ready", function() { debug("created pub connection"); that._updateReady("_ready_pub"); @@ -118,7 +118,7 @@ RedisAscoltatore.prototype._startSub = function() { topic = that._recvTopic(topic); payload = msgpack.decode(payload); - + if (ascoltatore) { ascoltatore.publish(topic, payload.message, payload.options); } else { @@ -199,7 +199,7 @@ RedisAscoltatore.prototype.publish = function publish(topic, message, options, d if (!topic.match(new RegExp('/$'))) { topic += '/'; } - + this._client.publish(topic, msgpack.encode(payload), function() { debug("new message published to " + topic); defer(done); diff --git a/test/redis_ascoltatore_spec.js b/test/redis_ascoltatore_spec.js index 58b996f..e9f7f26 100644 --- a/test/redis_ascoltatore_spec.js +++ b/test/redis_ascoltatore_spec.js @@ -47,7 +47,7 @@ describeAscoltatore("redis", function() { it('should get the redis client for publish already created', function(done) { var opts = redisSettings(); var initialConnection = new Redis(opts); - opts.client_conn = initialConnection; + opts.pub_conn = initialConnection; var that = this; that.instance = new ascoltatori.RedisAscoltatore(opts); that.instance.subscribe("hello", wrap(done), function() {