Skip to content

Commit

Permalink
Remove _ from subs
Browse files Browse the repository at this point in the history
  • Loading branch information
davedoesdev committed Nov 29, 2016
1 parent 8503574 commit fe2ce35
Show file tree
Hide file tree
Showing 10 changed files with 23 additions and 23 deletions.
2 changes: 1 addition & 1 deletion coverage/coverage.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion coverage/lcov-report/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ <h1>
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Tue Nov 29 2016 07:39:28 GMT+0000 (GMT)
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Tue Nov 29 2016 21:50:16 GMT+0000 (GMT)
</div>
</div>
<script src="prettify.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion coverage/lcov-report/mqlobber/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ <h1>
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Tue Nov 29 2016 07:39:28 GMT+0000 (GMT)
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Tue Nov 29 2016 21:50:16 GMT+0000 (GMT)
</div>
</div>
<script src="../prettify.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion coverage/lcov-report/mqlobber/index.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ <h1>
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Tue Nov 29 2016 07:39:28 GMT+0000 (GMT)
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Tue Nov 29 2016 21:50:16 GMT+0000 (GMT)
</div>
</div>
<script src="../prettify.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion coverage/lcov-report/mqlobber/lib/client.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -2311,7 +2311,7 @@ <h1>
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Tue Nov 29 2016 07:39:28 GMT+0000 (GMT)
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Tue Nov 29 2016 21:50:16 GMT+0000 (GMT)
</div>
</div>
<script src="../../prettify.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion coverage/lcov-report/mqlobber/lib/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ <h1>
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Tue Nov 29 2016 07:39:28 GMT+0000 (GMT)
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Tue Nov 29 2016 21:50:16 GMT+0000 (GMT)
</div>
</div>
<script src="../../prettify.js"></script>
Expand Down
16 changes: 8 additions & 8 deletions coverage/lcov-report/mqlobber/lib/server.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -1092,7 +1092,7 @@ <h1>
options = options || {};
&nbsp;
this.fsq = fsq;
this._subs = new Set();
this.subs = new Set();
this._done = false;
this.mux = new BPMux(stream, util._extend(util._extend({}, options),
{
Expand Down Expand Up @@ -1458,13 +1458,13 @@ <h1>
}
}
&nbsp;
if (!this._done &amp;&amp; !this._subs.has(topic))
if (!this._done &amp;&amp; !this.subs.has(topic))
{
this.fsq.subscribe(topic, this.handler, options, function (err)
{
if (!err)
{
ths._subs.add(topic);
ths.subs.add(topic);
}
cb2(err);
});
Expand Down Expand Up @@ -1520,15 +1520,15 @@ <h1>
}
else
{
ths._subs.delete(t);
ths.subs.delete(t);
process.nextTick(next);
}
});
},
&nbsp;
next = function ()
{
for (var t of ths._subs)
for (var t of ths.subs)
{
return unsub(t);
}
Expand All @@ -1537,13 +1537,13 @@ <h1>
&nbsp;
next();
}
else if (this._subs.has(topic))
else if (this.subs.has(topic))
{
this.fsq.unsubscribe(topic, this.handler, function (err)
{
if (!err)
{
ths._subs.delete(topic);
ths.subs.delete(topic);
}
cb2(err);
});
Expand All @@ -1561,7 +1561,7 @@ <h1>
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
Code coverage
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Tue Nov 29 2016 07:39:28 GMT+0000 (GMT)
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Tue Nov 29 2016 21:50:16 GMT+0000 (GMT)
</div>
</div>
<script src="../../prettify.js"></script>
Expand Down
14 changes: 7 additions & 7 deletions lib/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ function MQlobberServer(fsq, stream, options)
options = options || {};

this.fsq = fsq;
this._subs = new Set();
this.subs = new Set();
this._done = false;
this.mux = new BPMux(stream, util._extend(util._extend({}, options),
{
Expand Down Expand Up @@ -405,13 +405,13 @@ MQlobberServer.prototype.subscribe = function (topic, options, cb)
}
}

if (!this._done && !this._subs.has(topic))
if (!this._done && !this.subs.has(topic))
{
this.fsq.subscribe(topic, this.handler, options, function (err)
{
if (!err)
{
ths._subs.add(topic);
ths.subs.add(topic);
}
cb2(err);
});
Expand Down Expand Up @@ -467,15 +467,15 @@ MQlobberServer.prototype.unsubscribe = function (topic, cb)
}
else
{
ths._subs.delete(t);
ths.subs.delete(t);
process.nextTick(next);
}
});
},

next = function ()
{
for (var t of ths._subs)
for (var t of ths.subs)
{
return unsub(t);
}
Expand All @@ -484,13 +484,13 @@ MQlobberServer.prototype.unsubscribe = function (topic, cb)

next();
}
else if (this._subs.has(topic))
else if (this.subs.has(topic))
{
this.fsq.unsubscribe(topic, this.handler, function (err)
{
if (!err)
{
ths._subs.delete(topic);
ths.subs.delete(topic);
}
cb2(err);
});
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "mqlobber",
"description": "Streaming message queue with pub-sub, work queues, wildcards and back-pressure. Just Node and a filesystem required.",
"version": "2.7.0",
"version": "2.8.0",
"homepage": "https://github.com/davedoesdev/mqlobber",
"author": {
"name": "David Halls",
Expand Down
2 changes: 1 addition & 1 deletion test/runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -1756,7 +1756,7 @@ describe(type, function ()
with_mqs(1, 'server should callback without error when unsubscribing from topic not subscribed to',
function (mqs, cb)
{
expect(mqs[0].server._subs.has('foo')).to.equal(false);
expect(mqs[0].server.subs.has('foo')).to.equal(false);
mqs[0].server.unsubscribe('foo', cb);
});

Expand Down

0 comments on commit fe2ce35

Please sign in to comment.