Skip to content

Commit

Permalink
Expose default handler behaviour
Browse files Browse the repository at this point in the history
  • Loading branch information
davedoesdev committed Feb 5, 2017
1 parent 3b3ecac commit f8e5752
Show file tree
Hide file tree
Showing 10 changed files with 363 additions and 243 deletions.
2 changes: 1 addition & 1 deletion coverage/coverage.json

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions coverage/lcov-report/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ <h1>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Statements</span>
<span class='fraction'>427/427</span>
<span class='fraction'>437/437</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
Expand All @@ -32,12 +32,12 @@ <h1>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Functions</span>
<span class='fraction'>62/62</span>
<span class='fraction'>67/67</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Lines</span>
<span class='fraction'>427/427</span>
<span class='fraction'>437/437</span>
</div>
</div>
</div>
Expand Down Expand Up @@ -75,13 +75,13 @@ <h1>
<td class="file high" data-value="mqlobber/lib/"><a href="mqlobber/lib/index.html">mqlobber/lib/</a></td>
<td data-value="100" class="pic high"><div class="chart"><div class="cover-fill cover-full" style="width: 100%;"></div><div class="cover-empty" style="width:0%;"></div></div></td>
<td data-value="100" class="pct high">100%</td>
<td data-value="425" class="abs high">425/425</td>
<td data-value="435" class="abs high">435/435</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="216" class="abs high">216/216</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="62" class="abs high">62/62</td>
<td data-value="67" class="abs high">67/67</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="425" class="abs high">425/425</td>
<td data-value="435" class="abs high">435/435</td>
</tr>

</tbody>
Expand All @@ -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 Wed Feb 01 2017 21:05:28 GMT+0000 (GMT)
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Sun Feb 05 2017 07:12:45 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 Wed Feb 01 2017 21:05:28 GMT+0000 (GMT)
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Sun Feb 05 2017 07:12:45 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 Wed Feb 01 2017 21:05:28 GMT+0000 (GMT)
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Sun Feb 05 2017 07:12:45 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 @@ -2479,7 +2479,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 Wed Feb 01 2017 21:05:28 GMT+0000 (GMT)
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Sun Feb 05 2017 07:12:45 GMT+0000 (GMT)
</div>
</div>
<script src="../../prettify.js"></script>
Expand Down
14 changes: 7 additions & 7 deletions coverage/lcov-report/mqlobber/lib/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ <h1>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Statements</span>
<span class='fraction'>425/425</span>
<span class='fraction'>435/435</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
Expand All @@ -32,12 +32,12 @@ <h1>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Functions</span>
<span class='fraction'>62/62</span>
<span class='fraction'>67/67</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Lines</span>
<span class='fraction'>425/425</span>
<span class='fraction'>435/435</span>
</div>
</div>
</div>
Expand Down Expand Up @@ -75,13 +75,13 @@ <h1>
<td class="file high" data-value="server.js"><a href="server.js.html">server.js</a></td>
<td data-value="100" class="pic high"><div class="chart"><div class="cover-fill cover-full" style="width: 100%;"></div><div class="cover-empty" style="width:0%;"></div></div></td>
<td data-value="100" class="pct high">100%</td>
<td data-value="206" class="abs high">206/206</td>
<td data-value="216" class="abs high">216/216</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="106" class="abs high">106/106</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="32" class="abs high">32/32</td>
<td data-value="37" class="abs high">37/37</td>
<td data-value="100" class="pct high">100%</td>
<td data-value="206" class="abs high">206/206</td>
<td data-value="216" class="abs high">216/216</td>
</tr>

</tbody>
Expand All @@ -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 Wed Feb 01 2017 21:05:28 GMT+0000 (GMT)
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Sun Feb 05 2017 07:12:45 GMT+0000 (GMT)
</div>
</div>
<script src="../../prettify.js"></script>
Expand Down
125 changes: 100 additions & 25 deletions coverage/lcov-report/mqlobber/lib/server.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ <h1>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Statements</span>
<span class='fraction'>206/206</span>
<span class='fraction'>216/216</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
Expand All @@ -32,12 +32,12 @@ <h1>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Functions</span>
<span class='fraction'>32/32</span>
<span class='fraction'>37/37</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">100% </span>
<span class="quiet">Lines</span>
<span class='fraction'>206/206</span>
<span class='fraction'>216/216</span>
</div>
</div>
</div>
Expand Down Expand Up @@ -626,7 +626,32 @@ <h1>
581
582
583
584</td><td class="line-coverage quiet"><span class="cline-any cline-neutral">&nbsp;</span>
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609</td><td class="line-coverage quiet"><span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes"></span>
<span class="cline-any cline-neutral">&nbsp;</span>
Expand Down Expand Up @@ -893,13 +918,6 @@ <h1>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">440405×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">440405×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes"></span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">1904×</span>
Expand Down Expand Up @@ -1209,6 +1227,38 @@ <h1>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes"></span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">440405×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">440405×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes"></span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes"></span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">3586×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes"></span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">258×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes"></span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">264×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes"></span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes">49410×</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-yes"></span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">"use strict";
&nbsp;
var EventEmitter = require('events').EventEmitter,
Expand Down Expand Up @@ -1318,7 +1368,7 @@ <h1>
&nbsp;
if (!ths.emit('unsubscribe_all_requested', warning))
{
ths.unsubscribe();
ths.default_unsubscribe_all_requested_handler();
}
});
&nbsp;
Expand Down Expand Up @@ -1474,14 +1524,7 @@ <h1>
&nbsp;
if (!ths.emit('message', data, info, multiplex, cb))
{
try
{
data.pipe(multiplex());
}
catch (ex)
{
cb(ex);
}
ths.default_message_handler(data, info, multiplex, cb);
}
};
&nbsp;
Expand Down Expand Up @@ -1566,7 +1609,7 @@ <h1>
if (!ths.emit('pre_subscribe_requested', topic, done) &amp;&amp;
!ths.emit('subscribe_requested', topic, done))
{
ths.subscribe(topic, done);
ths.default_subscribe_requested_handler(topic, done);
}
break;
&nbsp;
Expand All @@ -1575,14 +1618,14 @@ <h1>
if (!ths.emit('pre_unsubscribe_requested', topic, done) &amp;&amp;
!ths.emit('unsubscribe_requested', topic, done))
{
ths.unsubscribe(topic, done);
ths.default_unsubscribe_requested_handler(topic, done);
}
break;
&nbsp;
case TYPE_UNSUBSCRIBE_ALL:
if (!ths.emit('unsubscribe_all_requested', done))
{
ths.unsubscribe(done);
ths.default_unsubscribe_all_requested_handler(done);
}
break;
&nbsp;
Expand Down Expand Up @@ -1617,7 +1660,7 @@ <h1>
if (!ths.emit('pre_publish_requested', topic, duplex, options, done) &amp;&amp;
!ths.emit('publish_requested', topic, duplex, options, done))
{
duplex.pipe(ths.fsq.publish(topic, options, done));
ths.default_publish_requested_handler(topic, duplex, options, done);
}
&nbsp;
break;
Expand Down Expand Up @@ -1791,14 +1834,46 @@ <h1>
}
};
&nbsp;
MQlobberServer.prototype.default_message_handler = function (data, info, multiplex, cb)
{
try
{
data.pipe(multiplex());
}
catch (ex)
{
cb(ex);
}
};
&nbsp;
MQlobberServer.prototype.default_subscribe_requested_handler = function (topic, done)
{
this.subscribe(topic, done);
};
&nbsp;
MQlobberServer.prototype.default_unsubscribe_requested_handler = function (topic, done)
{
this.unsubscribe(topic, done);
};
&nbsp;
MQlobberServer.prototype.default_unsubscribe_all_requested_handler = function (done)
{
this.unsubscribe(done);
};
&nbsp;
MQlobberServer.prototype.default_publish_requested_handler = function (topic, duplex, options, done)
{
duplex.pipe(this.fsq.publish(topic, options, done));
};
&nbsp;
exports.MQlobberServer = MQlobberServer;
&nbsp;</pre></td></tr>
</table></pre>
<div class='push'></div><!-- for sticky footer -->
</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 Wed Feb 01 2017 21:05:28 GMT+0000 (GMT)
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Sun Feb 05 2017 07:12:45 GMT+0000 (GMT)
</div>
</div>
<script src="../../prettify.js"></script>
Expand Down
Loading

0 comments on commit f8e5752

Please sign in to comment.