Comparing version 0.6.3 to 0.6.4
@@ -14,3 +14,3 @@ var type = require('../message/type') | ||
var QueueChannel = module.exports = function QueueChannel(socket, ns, name) { | ||
var QueueChannel = module.exports = function QueueChannel(socket, ns, name, emitter) { | ||
if (!ns) | ||
@@ -22,2 +22,3 @@ throw new Error('Channel queue requires namespace') | ||
this.chn = name | ||
this.emitter = emitter || socket | ||
} | ||
@@ -78,6 +79,6 @@ | ||
var socket = this.socket | ||
var emitter = this.emitter | ||
this.allow(pack, stream, function(pack, stream) { | ||
if (chn && INF === pack.type && AIN === pack.event) | ||
socket.emit('join', chn) | ||
emitter.emit('join', chn) | ||
dispatch(pack, stream) | ||
@@ -84,0 +85,0 @@ }) |
@@ -9,3 +9,3 @@ var que = require('./que') | ||
if (socket) { | ||
this.queue = new QueueChannel(socket, ns, chn) | ||
this.queue = new QueueChannel(socket, ns, chn, this) | ||
this.streams = socket.streams | ||
@@ -12,0 +12,0 @@ } else { |
{ | ||
"name": "socketmq", | ||
"version": "0.6.3", | ||
"version": "0.6.4", | ||
"description": "Lightweight stream-oriented messaging library for node.", | ||
@@ -14,8 +14,8 @@ "main": "index.js", | ||
"devDependencies": { | ||
"coveralls": "2.11.8", | ||
"engine.io": "1.6.8", | ||
"engine.io-client": "1.6.8", | ||
"coveralls": "2.11.9", | ||
"engine.io": "1.6.9", | ||
"engine.io-client": "1.6.9", | ||
"humanize-number": "0.0.2", | ||
"istanbul": "0.4.2", | ||
"nodemon": "1.9.1", | ||
"istanbul": "0.4.3", | ||
"nodemon": "1.9.2", | ||
"tape": "4.5.1" | ||
@@ -22,0 +22,0 @@ }, |
74106
2160