Skip to content

Commit

Permalink
Support exclude stream in getStreamsByTag
Browse files Browse the repository at this point in the history
  • Loading branch information
lsm committed Apr 13, 2016
1 parent 72de008 commit 58db750
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/socket/tag.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,12 @@ exports.hasTag = function(tag, stream) {
return this.streams.some(check)
}

exports.getStreamsByTag = function(tag, streams) {
exports.getStreamsByTag = function(tag, streams, excluding) {
return (streams || this.streams).filter(function(stream) {
var tags = stream.__smq_tags__
return Array.isArray(tags)
&& tags.indexOf(tag) > -1
&& stream !== excluding
})
}

Expand Down

0 comments on commit 58db750

Please sign in to comment.