From 47323f3515f1b889bb71fbefcf73a394f8c92b20 Mon Sep 17 00:00:00 2001 From: Philip Patzer Date: Tue, 9 Feb 2016 15:49:54 +0100 Subject: [PATCH] create a operate replyTo queue per instance --- index.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 44c965f..f651bc5 100644 --- a/index.js +++ b/index.js @@ -27,15 +27,18 @@ function rpc(opt) { this.__connCbs = []; this.__exchangeCbs = []; + + rpc.__instanceCount++; } +rpc.__instanceCount = 0; + /** * generate unique name for new queue * @returns {string} */ - rpc.prototype.generateQueueName = function(type) { - return /*'njsListener:' +*/ os.hostname() + ':pid' + process.pid + ':' + type; + return /*'njsListener:' +*/ os.hostname() + ':pid' + process.pid + ':' + rpc.__instanceCount + ':' + type; }