Skip to content

Commit

Permalink
Encode topics by default
Browse files Browse the repository at this point in the history
  • Loading branch information
davedoesdev committed May 21, 2016
1 parent cb7d8f1 commit 84ee19e
Show file tree
Hide file tree
Showing 12 changed files with 1,143 additions and 1,081 deletions.
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -251,7 +251,7 @@ If you provide at least one `--remote <host>` argument then the benchmark will b
- `{Object} [options]` Configures the file system queue. Valid properties are listed below:
- `{String} fsq_dir` The path to the file system queue directory. Note that the following sub-directories will be created under this directory if they don't exist: `messages`, `staging`, `topics` and `update`. Defaults to a directory named `fsq` in the `qlobber-fsq` module directory.

- `{Boolean} encode_topics` Whether to hex-encode message topics. By default, unencoded topic strings are used as part of message filenames. If you can't ensure that topics contain only valid filename characters, set this to `true`. The hex-encoded topic will then be used in the filename and decoded before matching the topic against subscribers.
- `{Boolean} encode_topics` Whether to hex-encode message topics. Because topic strings form part of message filenames, they're first hex-encoded. If you can ensure that your message topics contain only valid filename characters, set this to `false` to skip encoding.

- `{Integer} split_topic_at` Maximum number of characters in a short topic. Short topics are contained entirely in a message's filename. Long topics are split so the first `split_topic_at` characters go in the filename and the rest are written to a separate file in the `topics` sub-directory. Obviously long topics are less efficient. Defaults to 200, which is the maximum for most common file systems. Note: if your `fsq_dir` is on an [`ecryptfs`](http://ecryptfs.org/) file system then you should set `split_topic_at` to 100.

Expand Down Expand Up @@ -342,7 +342,7 @@ If you provide at least one `--remote <host>` argument then the benchmark will b
**Parameters:**

- `{String} topic` Message topic. The topic should be a series of words separated by `.` (or the `separator` character you provided to the [`QlobberFSQ constructor`](#qlobberfsqoptions)). Since the unencoded topic string is used as part of the message's filename, topic words can contain any valid file name character for your file system. However, it's probably sensible to limit it to alphanumeric characters, `-`, `_` and `.`. If you can't do this then set `encode_topics` to `true` in the [`QlobberFSQ constructor`](#qlobberfsqoptions).
- `{String} topic` Message topic. The topic should be a series of words separated by `.` (or the `separator` character you provided to the [`QlobberFSQ constructor`](#qlobberfsqoptions)). Topic words can contain any character, unless you set `encode_topics` to `false` in the [`QlobberFSQ constructor`](#qlobberfsqoptions). In that case they can contain any valid filename character for your file system, although it's probably sensible to limit it to alphanumeric characters, `-`, `_` and `.`.
- `{String | Buffer} [payload]` Message payload. If you don't pass a payload then `publish` will return a [Writable stream](http://nodejs.org/api/stream.html#stream_class_stream_writable) for you to write the payload into.
- `{Object} [options]` Optional settings for this publication:
- `{Boolean} single` If `true` then the message will be given to _at most_ one interested subscriber, across all `QlobberFSQ` objects scanning the file system queue. Otherwise all interested subscribers will receive the message.
Expand Down
2 changes: 1 addition & 1 deletion coverage/coverage.json

Large diffs are not rendered by default.

20 changes: 10 additions & 10 deletions coverage/lcov-report/index.html
Expand Up @@ -20,14 +20,14 @@ <h1>
</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">93.28% </span>
<span class="strong">93.48% </span>
<span class="quiet">Statements</span>
<span class='fraction'>458/491</span>
<span class='fraction'>459/491</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">86.67% </span>
<span class="strong">87.07% </span>
<span class="quiet">Branches</span>
<span class='fraction'>273/315</span>
<span class='fraction'>276/317</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">98.86% </span>
Expand Down Expand Up @@ -73,11 +73,11 @@ <h1>

<tr>
<td class="file high" data-value="qlobber-fsq/lib/"><a href="qlobber-fsq/lib/index.html">qlobber-fsq/lib/</a></td>
<td data-value="93.04" class="pic high"><div class="chart"><div class="cover-fill" style="width: 93%;"></div><div class="cover-empty" style="width:7%;"></div></div></td>
<td data-value="93.04" class="pct high">93.04%</td>
<td data-value="474" class="abs high">441/474</td>
<td data-value="86.9" class="pct high">86.9%</td>
<td data-value="313" class="abs high">272/313</td>
<td data-value="93.25" class="pic high"><div class="chart"><div class="cover-fill" style="width: 93%;"></div><div class="cover-empty" style="width:7%;"></div></div></td>
<td data-value="93.25" class="pct high">93.25%</td>
<td data-value="474" class="abs high">442/474</td>
<td data-value="87.3" class="pct high">87.3%</td>
<td data-value="315" class="abs high">275/315</td>
<td data-value="98.85" class="pct high">98.85%</td>
<td data-value="87" class="abs high">86/87</td>
<td data-value="97.49" class="pct high">97.49%</td>
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 Sat May 21 2016 07:43:22 GMT+0100 (BST)
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Sat May 21 2016 22:20:59 GMT+0100 (BST)
</div>
</div>
<script src="prettify.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion coverage/lcov-report/qlobber-fsq/Gruntfile.js.html
Expand Up @@ -301,7 +301,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 Sat May 21 2016 07:43:22 GMT+0100 (BST)
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Sat May 21 2016 22:20:59 GMT+0100 (BST)
</div>
</div>
<script src="../prettify.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion coverage/lcov-report/qlobber-fsq/index.html
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 Sat May 21 2016 07:43:22 GMT+0100 (BST)
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Sat May 21 2016 22:20:59 GMT+0100 (BST)
</div>
</div>
<script src="../prettify.js"></script>
Expand Down
2 changes: 1 addition & 1 deletion coverage/lcov-report/qlobber-fsq/index.js.html
Expand Up @@ -58,7 +58,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 Sat May 21 2016 07:43:22 GMT+0100 (BST)
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Sat May 21 2016 22:20:59 GMT+0100 (BST)
</div>
</div>
<script src="../prettify.js"></script>
Expand Down
20 changes: 10 additions & 10 deletions coverage/lcov-report/qlobber-fsq/lib/index.html
Expand Up @@ -20,14 +20,14 @@ <h1>
</h1>
<div class='clearfix'>
<div class='fl pad1y space-right2'>
<span class="strong">93.04% </span>
<span class="strong">93.25% </span>
<span class="quiet">Statements</span>
<span class='fraction'>441/474</span>
<span class='fraction'>442/474</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">86.9% </span>
<span class="strong">87.3% </span>
<span class="quiet">Branches</span>
<span class='fraction'>272/313</span>
<span class='fraction'>275/315</span>
</div>
<div class='fl pad1y space-right2'>
<span class="strong">98.85% </span>
Expand Down Expand Up @@ -60,11 +60,11 @@ <h1>
</thead>
<tbody><tr>
<td class="file high" data-value="qlobber-fsq.js"><a href="qlobber-fsq.js.html">qlobber-fsq.js</a></td>
<td data-value="93.04" class="pic high"><div class="chart"><div class="cover-fill" style="width: 93%;"></div><div class="cover-empty" style="width:7%;"></div></div></td>
<td data-value="93.04" class="pct high">93.04%</td>
<td data-value="474" class="abs high">441/474</td>
<td data-value="86.9" class="pct high">86.9%</td>
<td data-value="313" class="abs high">272/313</td>
<td data-value="93.25" class="pic high"><div class="chart"><div class="cover-fill" style="width: 93%;"></div><div class="cover-empty" style="width:7%;"></div></div></td>
<td data-value="93.25" class="pct high">93.25%</td>
<td data-value="474" class="abs high">442/474</td>
<td data-value="87.3" class="pct high">87.3%</td>
<td data-value="315" class="abs high">275/315</td>
<td data-value="98.85" class="pct high">98.85%</td>
<td data-value="87" class="abs high">86/87</td>
<td data-value="97.49" class="pct high">97.49%</td>
Expand All @@ -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 Sat May 21 2016 07:43:22 GMT+0100 (BST)
generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Sat May 21 2016 22:20:59 GMT+0100 (BST)
</div>
</div>
<script src="../../prettify.js"></script>
Expand Down

0 comments on commit 84ee19e

Please sign in to comment.