Skip to content

Commit

Permalink
add better transport example in readme
Browse files Browse the repository at this point in the history
  • Loading branch information
esatterwhite committed May 28, 2017
1 parent ce18381 commit a1e00f5
Show file tree
Hide file tree
Showing 37 changed files with 99 additions and 53 deletions.
14 changes: 12 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,17 +169,27 @@ that can be executed when a timer triggers. To register a transport, you can pas
requireable paths to the skyring server constructor via via the `transports` option

Optionally, for transports that need to perform some clean up work, a function property `shutdown` may be defined
<<<<<<< ce183811b4fac9c8e4a42d83477318aa026d3bac
on the transport
=======
on the transport
>>>>>>> update docs
```javascript
const path = require('path')
const Skyring = require('skyring')

function fizzbuz(method, uri, payload, id, timer_cache) {
...
function fizzbuz(method, uri, payload, id, timer_store) {
// send payload to uri...
timer_store.remove(id)
}

fuzzbuz.shutdown(cb) {
<<<<<<< ce183811b4fac9c8e4a42d83477318aa026d3bac
// do some work
=======
// drain connections...
// free up event loop
>>>>>>> update docs
cb()
}

Expand Down
2 changes: 1 addition & 1 deletion docs/api/api_project.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ define({
"apidoc": "0.2.0",
"generator": {
"name": "apidoc",
"time": "2017-05-28T03:04:41.992Z",
"time": "2017-05-28T03:11:03.017Z",
"url": "http://apidocjs.com",
"version": "0.16.1"
}
Expand Down
2 changes: 1 addition & 1 deletion docs/api/api_project.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"apidoc": "0.2.0",
"generator": {
"name": "apidoc",
"time": "2017-05-28T03:04:41.992Z",
"time": "2017-05-28T03:11:03.017Z",
"url": "http://apidocjs.com",
"version": "0.16.1"
}
Expand Down
68 changes: 52 additions & 16 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -156,27 +156,63 @@ <h2>Create a timer</h2><h5><strong>POST <code>/timer</code></strong></h5><p><str
that can be executed when a timer triggers. To register a transport, you can pass an array of named functions, or
requireable paths to the skyring server constructor via via the <code>transports</code> option</p>
<p>Optionally, for transports that need to perform some clean up work, a function property <code>shutdown</code> may be defined
on the transport </p>
<pre class="prettyprint source lang-javascript"><code>const path = require('path')
const Skyring = require('skyring')

function fizzbuz(method, uri, payload, id, timer_cache) {
...
}

fuzzbuz.shutdown(cb) {
// do some work
&lt;&lt;&lt;&lt;&lt;&lt;&lt; ce183811b4fac9c8e4a42d83477318aa026d3bac</p>
<h1>on the transport </h1><p>on the transport</p>
<blockquote>
<blockquote>
<blockquote>
<blockquote>
<blockquote>
<blockquote>
<blockquote>
<p>update docs
```javascript
const path = require('path')
const Skyring = require('skyring')</p>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
<p>function fizzbuz(method, uri, payload, id, timer_store) {
// send payload to uri...
timer_store.remove(id)
}</p>
<p>fuzzbuz.shutdown(cb) {
&lt;&lt;&lt;&lt;&lt;&lt;&lt; ce183811b4fac9c8e4a42d83477318aa026d3bac</p>
<h1> // do some work</h1><p> // drain connections...
// free up event loop</p>
<blockquote>
<blockquote>
<blockquote>
<blockquote>
<blockquote>
<blockquote>
<blockquote>
<p>update docs
cb()
}

const server = new Skyring({
}</p>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
</blockquote>
<p>const server = new Skyring({
transports: [
'my-transport-module'
, fizzbuz
, path.resolve(__dirname, '../transports/fake-transport')
]
})</code></pre><p>The same can be achieved through CLI arguments or ENV vars via the <code>transport</code> key</p>
<pre class="prettyprint source lang-bash"><code>transport=foobar,fizzbuz node index.js</code></pre><pre class="prettyprint source lang-bash"><code>node index --transport=foobar --transport=fizzbuz --transport=$PWD/../path/to/my-transport</code></pre></article>
})</p>
<pre class="prettyprint source"><code>
The same can be achieved through CLI arguments or ENV vars via the `transport` key

```bash
transport=foobar,fizzbuz node index.js</code></pre><pre class="prettyprint source lang-bash"><code>node index --transport=foobar --transport=fizzbuz --transport=$PWD/../path/to/my-transport</code></pre></article>
</section>


Expand Down Expand Up @@ -226,7 +262,7 @@ <h4 class="modal-title">Search results</h4>
<span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a>

on 2017-05-27T22:04:40-05:00
on 2017-05-27T22:11:02-05:00

using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
</span>
Expand Down
2 changes: 1 addition & 1 deletion docs/index.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ <h4 class="modal-title">Search results</h4>
<span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a>

on 2017-05-27T22:04:40-05:00
on 2017-05-27T22:11:02-05:00

using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
</span>
Expand Down
2 changes: 1 addition & 1 deletion docs/lib_json.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ <h4 class="modal-title">Search results</h4>
<span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a>

on 2017-05-27T22:04:40-05:00
on 2017-05-27T22:11:02-05:00

using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
</span>
Expand Down
2 changes: 1 addition & 1 deletion docs/lib_nats.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ <h4 class="modal-title">Search results</h4>
<span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a>

on 2017-05-27T22:04:40-05:00
on 2017-05-27T22:11:02-05:00

using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
</span>
Expand Down
2 changes: 1 addition & 1 deletion docs/lib_server_index.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ <h4 class="modal-title">Search results</h4>
<span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a>

on 2017-05-27T22:04:40-05:00
on 2017-05-27T22:11:02-05:00

using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
</span>
Expand Down
2 changes: 1 addition & 1 deletion docs/lib_server_mock.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ <h4 class="modal-title">Search results</h4>
<span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a>

on 2017-05-27T22:04:40-05:00
on 2017-05-27T22:11:02-05:00

using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
</span>
Expand Down
2 changes: 1 addition & 1 deletion docs/lib_server_node.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ <h4 class="modal-title">Search results</h4>
<span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a>

on 2017-05-27T22:04:40-05:00
on 2017-05-27T22:11:02-05:00

using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
</span>
Expand Down
2 changes: 1 addition & 1 deletion docs/lib_server_request.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ <h4 class="modal-title">Search results</h4>
<span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a>

on 2017-05-27T22:04:40-05:00
on 2017-05-27T22:11:02-05:00

using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
</span>
Expand Down
2 changes: 1 addition & 1 deletion docs/lib_server_response.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ <h4 class="modal-title">Search results</h4>
<span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a>

on 2017-05-27T22:04:40-05:00
on 2017-05-27T22:11:02-05:00

using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
</span>
Expand Down
2 changes: 1 addition & 1 deletion docs/lib_server_route.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ <h4 class="modal-title">Search results</h4>
<span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a>

on 2017-05-27T22:04:40-05:00
on 2017-05-27T22:11:02-05:00

using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
</span>
Expand Down
2 changes: 1 addition & 1 deletion docs/lib_server_router.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ <h4 class="modal-title">Search results</h4>
<span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a>

on 2017-05-27T22:04:40-05:00
on 2017-05-27T22:11:02-05:00

using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
</span>
Expand Down
2 changes: 1 addition & 1 deletion docs/lib_timer.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ <h4 class="modal-title">Search results</h4>
<span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a>

on 2017-05-27T22:04:40-05:00
on 2017-05-27T22:11:02-05:00

using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
</span>
Expand Down
2 changes: 1 addition & 1 deletion docs/lib_transports_callback.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ <h4 class="modal-title">Search results</h4>
<span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a>

on 2017-05-27T22:04:40-05:00
on 2017-05-27T22:11:02-05:00

using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
</span>
Expand Down
2 changes: 1 addition & 1 deletion docs/lib_transports_http.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ <h4 class="modal-title">Search results</h4>
<span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a>

on 2017-05-27T22:04:40-05:00
on 2017-05-27T22:11:02-05:00

using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
</span>
Expand Down
2 changes: 1 addition & 1 deletion docs/lib_transports_index.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ <h4 class="modal-title">Search results</h4>
<span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a>

on 2017-05-27T22:04:40-05:00
on 2017-05-27T22:11:02-05:00

using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
</span>
Expand Down
2 changes: 1 addition & 1 deletion docs/module-keef.html
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ <h4 class="modal-title">Search results</h4>
<span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a>

on 2017-05-27T22:04:40-05:00
on 2017-05-27T22:11:02-05:00

using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
</span>
Expand Down
2 changes: 1 addition & 1 deletion docs/module-skyring.html
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ <h4 class="modal-title">Search results</h4>
<span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a>

on 2017-05-27T22:04:40-05:00
on 2017-05-27T22:11:02-05:00

using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
</span>
Expand Down
2 changes: 1 addition & 1 deletion docs/module-skyring_conf.html
Original file line number Diff line number Diff line change
Expand Up @@ -705,7 +705,7 @@ <h4 class="modal-title">Search results</h4>
<span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a>

on 2017-05-27T22:04:40-05:00
on 2017-05-27T22:11:02-05:00

using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
</span>
Expand Down
2 changes: 1 addition & 1 deletion docs/module-skyring_lib_json.html
Original file line number Diff line number Diff line change
Expand Up @@ -501,7 +501,7 @@ <h4 class="modal-title">Search results</h4>
<span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a>

on 2017-05-27T22:04:40-05:00
on 2017-05-27T22:11:02-05:00

using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
</span>
Expand Down
2 changes: 1 addition & 1 deletion docs/module-skyring_lib_nats.html
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ <h4 class="modal-title">Search results</h4>
<span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a>

on 2017-05-27T22:04:40-05:00
on 2017-05-27T22:11:02-05:00

using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
</span>
Expand Down
2 changes: 1 addition & 1 deletion docs/module-skyring_lib_server.html
Original file line number Diff line number Diff line change
Expand Up @@ -1229,7 +1229,7 @@ <h4 class="modal-title">Search results</h4>
<span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a>

on 2017-05-27T22:04:40-05:00
on 2017-05-27T22:11:02-05:00

using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
</span>
Expand Down
2 changes: 1 addition & 1 deletion docs/module-skyring_lib_server_mock.html
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ <h4 class="modal-title">Search results</h4>
<span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a>

on 2017-05-27T22:04:40-05:00
on 2017-05-27T22:11:02-05:00

using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
</span>
Expand Down
2 changes: 1 addition & 1 deletion docs/module-skyring_lib_server_node.html
Original file line number Diff line number Diff line change
Expand Up @@ -1574,7 +1574,7 @@ <h4 class="modal-title">Search results</h4>
<span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a>

on 2017-05-27T22:04:40-05:00
on 2017-05-27T22:11:02-05:00

using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
</span>
Expand Down
2 changes: 1 addition & 1 deletion docs/module-skyring_lib_server_request.html
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ <h4 class="modal-title">Search results</h4>
<span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a>

on 2017-05-27T22:04:40-05:00
on 2017-05-27T22:11:02-05:00

using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
</span>
Expand Down
2 changes: 1 addition & 1 deletion docs/module-skyring_lib_server_response.html
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ <h4 class="modal-title">Search results</h4>
<span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a>

on 2017-05-27T22:04:40-05:00
on 2017-05-27T22:11:02-05:00

using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
</span>
Expand Down
2 changes: 1 addition & 1 deletion docs/module-skyring_lib_server_route.html
Original file line number Diff line number Diff line change
Expand Up @@ -820,7 +820,7 @@ <h4 class="modal-title">Search results</h4>
<span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a>

on 2017-05-27T22:04:40-05:00
on 2017-05-27T22:11:02-05:00

using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
</span>
Expand Down
2 changes: 1 addition & 1 deletion docs/module-skyring_lib_server_router.html
Original file line number Diff line number Diff line change
Expand Up @@ -1838,7 +1838,7 @@ <h4 class="modal-title">Search results</h4>
<span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a>

on 2017-05-27T22:04:40-05:00
on 2017-05-27T22:11:02-05:00

using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
</span>
Expand Down
2 changes: 1 addition & 1 deletion docs/module-skyring_lib_timer.html
Original file line number Diff line number Diff line change
Expand Up @@ -2166,7 +2166,7 @@ <h4 class="modal-title">Search results</h4>
<span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a>

on 2017-05-27T22:04:41-05:00
on 2017-05-27T22:11:02-05:00

using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
</span>
Expand Down
2 changes: 1 addition & 1 deletion docs/module-skyring_lib_transports.html
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ <h4 class="modal-title">Search results</h4>
<span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a>

on 2017-05-27T22:04:41-05:00
on 2017-05-27T22:11:02-05:00

using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
</span>
Expand Down
2 changes: 1 addition & 1 deletion docs/module-skyring_lib_transports_http.html
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ <h4 class="modal-title">Search results</h4>
<span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a>

on 2017-05-27T22:04:41-05:00
on 2017-05-27T22:11:02-05:00

using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
</span>
Expand Down
Loading

0 comments on commit a1e00f5

Please sign in to comment.