Skip to content

Commit

Permalink
server: remove server#load function
Browse files Browse the repository at this point in the history
it has been deprecated and stubbed for a number of major versions.
finally removed from server class, tests and docs

Semver: major
  • Loading branch information
esatterwhite committed Dec 1, 2018
1 parent 602b30c commit e365793
Show file tree
Hide file tree
Showing 59 changed files with 234 additions and 224 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
A distributed reliable timer service providing `setTimeout` functionality in a distributed fashion.
`Skyring` servers are clustered into a *hashring* using consistent hashing to partition timers to specific nodes in the ring. Skyring exposes a simple HTTP API that allows to you create and cancel timers. Timer execution comes in to the form of an HTTP webhook ( more transports to come )

# Architechture Overview
# Architecture Overview

<img src="https://raw.githubusercontent.com/esatterwhite/skyring/master/assets/skyring-arch.png" width="100%" max-width="800px">

Expand Down Expand Up @@ -56,7 +56,7 @@ DEBUG=skyring:* skyring run -p 3000 -s localhost:3456 -s localhost:3455
### Using in your project

If you want to use the skyring directly, you can just require it and start it directly.
most of the available enviroment and cli arguments can be passed to the {@link module:skyring/lib/server|skyring constructor}.
most of the available environment and cli arguments can be passed to the {@link module:skyring/lib/server|skyring constructor}.
If you don't pass anything to the construct the default values are {@link module:keef|loaded} from the appropriate sources

```javascript
Expand All @@ -70,7 +70,7 @@ function onSignal() {
});
}

server.load().listen(3000, (err) => {
server.listen(3000, (err) => {
if (err) throw err
console.log('skyring listening at %s', 'http://0.0.0.0:3000')
})
Expand Down Expand Up @@ -191,7 +191,7 @@ skyring run --storage:backend=leveldown --storage:path='/var/data/skyring'
In situations when the local disk is not reliable enough, you can install and use any levelup backend to suite your needs.
If, for example you want to off load data storage to a [mongo](https://github.com/esatterwhite/skyring/tree/master/examples/mongo-storage)
or [scylladb](https://github.com/esatterwhite/skyring/tree/master/examples/scylla-storage) cluster, you would just include the backend package
as a dependency in your project and specify it by name as the stoargae package. Options for the backend can be passed via the `storage` attribute
as a dependency in your project and specify it by name as the storage package. Options for the backend can be passed via the `storage` attribute

```bash
npm install @skyring/scylladown
Expand All @@ -203,7 +203,7 @@ skyring run --storage:backend=@skyring/scylladown --storage:path=skyring-2 --sto

Skyring ships with a single HTTP transport, but support custom transports. A `transport` is a named function
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 {@link module:skyring/lib/transports|transports} option
module file paths to the skyring server constructor via via the {@link module:skyring/lib/transports|transports} option

Optionally, for transports that need to perform some clean up work, a function property `shutdown` may be defined
on the transport
Expand Down
6 changes: 3 additions & 3 deletions docs/api/api_project.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
define({
"name": "skyring",
"version": "6.1.0",
"version": "7.0.1",
"description": "Distributed timers as a service",
"sampleUrl": false,
"defaultVersion": "0.0.0",
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
"time": "2018-11-07T02:04:12.519Z",
"time": "2018-11-30T21:51:17.815Z",
"url": "http://apidocjs.com",
"version": "0.17.6"
"version": "0.17.7"
}
});
6 changes: 3 additions & 3 deletions docs/api/api_project.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"name": "skyring",
"version": "6.1.0",
"version": "7.0.1",
"description": "Distributed timers as a service",
"sampleUrl": false,
"defaultVersion": "0.0.0",
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
"time": "2018-11-07T02:04:12.519Z",
"time": "2018-11-30T21:51:17.815Z",
"url": "http://apidocjs.com",
"version": "0.17.6"
"version": "0.17.7"
}
}
25 changes: 25 additions & 0 deletions docs/api/locales/cs.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
define({
cs: {
'Allowed values:' : 'Povolené hodnoty:',
'Compare all with predecessor': 'Porovnat vše s předchozími verzemi',
'compare changes to:' : 'porovnat změny s:',
'compared to' : 'porovnat s',
'Default value:' : 'Výchozí hodnota:',
'Description' : 'Popis',
'Field' : 'Pole',
'General' : 'Obecné',
'Generated with' : 'Vygenerováno pomocí',
'Name' : 'Název',
'No response values.' : 'Nebyly vráceny žádné hodnoty.',
'optional' : 'volitelné',
'Parameter' : 'Parametr',
'Permission:' : 'Oprávnění:',
'Response' : 'Odpověď',
'Send' : 'Odeslat',
'Send a Sample Request' : 'Odeslat ukázkový požadavek',
'show up to version:' : 'zobrazit po verzi:',
'Size range:' : 'Rozsah velikosti:',
'Type' : 'Typ',
'url' : 'url'
}
});
1 change: 1 addition & 0 deletions docs/api/locales/locale.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
define([
'./locales/ca.js',
'./locales/cs.js',
'./locales/de.js',
'./locales/es.js',
'./locales/fr.js',
Expand Down
2 changes: 1 addition & 1 deletion docs/classes.list.html
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ <h4 class="modal-title">Search results</h4>
<span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>

on 2018-11-06T21:04:11-05:00
on 2018-11-30T16:51:16-05:00

using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
</span>
Expand Down
2 changes: 1 addition & 1 deletion docs/global.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.5.5</a>

on 2018-11-06T21:04:11-05:00
on 2018-11-30T16:51:16-05:00

using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
</span>
Expand Down
16 changes: 8 additions & 8 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@


<section class="readme-section">
<article><p><img src="https://github.com/esatterwhite/skyring/raw/master/assets/skyring-inverted.png" alt="skyring"></p>
<article><p><img src="https://github.com/esatterwhite/skyring/raw/master/assets/skyring.png" alt="skyring"></p>
<p><a href="skyring"><img src="https://img.shields.io/travis/esatterwhite/skyring/master.svg?style=flat-square" alt="Travis branch"></a>
<a href="https://www.npmjs.com/package/skyring"><img src="https://img.shields.io/npm/v/skyring.svg?style=flat-square" alt="npm"></a>
<a href="https://github.com/esatterwhite/skyring"><img src="https://img.shields.io/npm/l/skyring.svg?style=flat-square" alt="npm"></a>
Expand All @@ -120,7 +120,7 @@
</ul>
<h1>Skyring</h1><p>A distributed reliable timer service providing <code>setTimeout</code> functionality in a distributed fashion.
<code>Skyring</code> servers are clustered into a <em>hashring</em> using consistent hashing to partition timers to specific nodes in the ring. Skyring exposes a simple HTTP API that allows to you create and cancel timers. Timer execution comes in to the form of an HTTP webhook ( more transports to come )</p>
<h1>Architechture Overview</h1><p><img src="https://raw.githubusercontent.com/esatterwhite/skyring/master/assets/skyring-arch-inverted.png" width="100%" max-width="800px"></p>
<h1>Architecture Overview</h1><p><img src="https://raw.githubusercontent.com/esatterwhite/skyring/master/assets/skyring-arch.png" width="100%" max-width="800px"></p>
<h1>Install</h1><pre class="prettyprint source"><code>npm install -s skyring</code></pre><h2>Run A Local Cluster</h2><h3>Start a nats instance</h3><p>Download the <a href="https://github.com/nats-io/gnatsd/releases">nats binary</a> and start it using the defaults</p>
<pre class="prettyprint source lang-bash"><code>$ gnats -D -V</code></pre><p>To verify that it is working, you can <code>telnet</code> directly to the server and ping it.</p>
<pre class="prettyprint source lang-bash"><code>$ telnet localhost 4222
Expand All @@ -129,7 +129,7 @@ <h1>Install</h1><pre class="prettyprint source"><code>npm install -s skyring</co
<pre class="prettyprint source"><code>npm install -g skyring

DEBUG=skyring:* skyring run -p 3000 -s localhost:3456 -s localhost:3455</code></pre><h3>Using in your project</h3><p>If you want to use the skyring directly, you can just require it and start it directly.
most of the available enviroment and cli arguments can be passed to the <a href="module-skyring_lib_server.html">skyring constructor</a>.
most of the available environment and cli arguments can be passed to the <a href="module-skyring_lib_server.html">skyring constructor</a>.
If you don't pass anything to the construct the default values are <a href="module-keef.html">loaded</a> from the appropriate sources</p>
<pre class="prettyprint source lang-javascript"><code>// index.js
const Skyring = require('skyring')
Expand All @@ -141,7 +141,7 @@ <h1>Install</h1><pre class="prettyprint source"><code>npm install -s skyring</co
});
}

server.load().listen(3000, (err) => {
server.listen(3000, (err) => {
if (err) throw err
console.log('skyring listening at %s', 'http://0.0.0.0:3000')
})
Expand Down Expand Up @@ -195,12 +195,12 @@ <h2>Create a timer</h2><h5><strong>POST <code>/timer</code></strong></h5><p><str
<pre class="prettyprint source lang-bash"><code>skyring run --storage:backend=leveldown --storage:path='/var/data/skyring'</code></pre><h3>Custom Storage</h3><p>In situations when the local disk is not reliable enough, you can install and use any levelup backend to suite your needs.
If, for example you want to off load data storage to a <a href="https://github.com/esatterwhite/skyring/tree/master/examples/mongo-storage">mongo</a>
or <a href="https://github.com/esatterwhite/skyring/tree/master/examples/scylla-storage">scylladb</a> cluster, you would just include the backend package
as a dependency in your project and specify it by name as the stoargae package. Options for the backend can be passed via the <code>storage</code> attribute</p>
as a dependency in your project and specify it by name as the storage package. Options for the backend can be passed via the <code>storage</code> attribute</p>
<pre class="prettyprint source lang-bash"><code>npm install @skyring/scylladown
skyring run --storage:backend=@skyring/scylladown --storage:path=skyring-1 --storage:contactPoints=0.0.0.0:9042 --storage:contactPoints=0.0.0.0:9043
skyring run --storage:backend=@skyring/scylladown --storage:path=skyring-2 --storage:contactPoints=0.0.0.0:9042 --storage:contactPoints=0.0.0.0:9043</code></pre><h1>Custom Transports</h1><p>Skyring ships with a single HTTP transport, but support custom transports. A <code>transport</code> is a named function
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 <a href="module-skyring_lib_transports.html">transports</a> option</p>
module file paths to the skyring server constructor via via the <a href="module-skyring_lib_transports.html">transports</a> 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')
Expand Down Expand Up @@ -274,7 +274,7 @@ <h4 class="modal-title">Search results</h4>
<span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>

on 2018-11-06T21:04:11-05:00
on 2018-11-30T16:51:16-05:00

using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
</span>
Expand Down Expand Up @@ -365,4 +365,4 @@ <h4 class="modal-title">Search results</h4>


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

on 2018-11-06T21:04:11-05:00
on 2018-11-30T16:51:16-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 @@ -167,7 +167,7 @@ <h4 class="modal-title">Search results</h4>
<span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>

on 2018-11-06T21:04:11-05:00
on 2018-11-30T16:51:16-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 @@ -229,7 +229,7 @@ <h4 class="modal-title">Search results</h4>
<span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>

on 2018-11-06T21:04:11-05:00
on 2018-11-30T16:51:16-05:00

using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
</span>
Expand Down
13 changes: 4 additions & 9 deletions docs/lib_server_index.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ <h1 class="page-title">Source: lib/server/index.js</h1>
* @param {String[]|Function[]} [options.transports] an array of custom transport functions, or requireable paths that resolve to functions. All transport function must be named functions
* @example
// Use only configuration values
var server = new Server().load().listen(5000)
var server = new Server().listen(5000)
* @example var server = new Server({
node :{
host: 172.17.0.9
Expand All @@ -142,15 +142,15 @@ <h1 class="page-title">Source: lib/server/index.js</h1>
servers: ['nats1.domain.com:4222', 'nats2.domain.com:4222']
}
})
server.load().listen(5000)
server.listen(5000)
* @example // Use a custom node instance
var node = new Node({
host: 172.17.0.9
, port: 8456
, app: 'payback'
})
var server = new Server({ node })
server.load().listen(5000)
server.listen(5000)
*/
class Server extends http.Server {
constructor(opts = {}){
Expand All @@ -164,7 +164,6 @@ <h1 class="page-title">Source: lib/server/index.js</h1>
, storage: null
, transports: []
}, opts);
this.loaded = false;
if( opts.node ){
this._node = opts.node instanceof Node
? opts.node
Expand All @@ -181,10 +180,6 @@ <h1 class="page-title">Source: lib/server/index.js</h1>
this._node.on('bootstrap', (seeds) => {
this.emit('bootstrap', seeds);
});

this.load = util.deprecate(() => {
return this
}, 'server#load is deprecated and will be removed in future version')
}

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

on 2018-11-06T21:04:11-05:00
on 2018-11-30T16:51:16-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 @@ -317,7 +317,7 @@ <h4 class="modal-title">Search results</h4>
<span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>

on 2018-11-06T21:04:11-05:00
on 2018-11-30T16:51:16-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 @@ -340,7 +340,7 @@ <h4 class="modal-title">Search results</h4>
<span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>

on 2018-11-06T21:04:11-05:00
on 2018-11-30T16:51:16-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 @@ -220,7 +220,7 @@ <h4 class="modal-title">Search results</h4>
<span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>

on 2018-11-06T21:04:11-05:00
on 2018-11-30T16:51:16-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 @@ -261,7 +261,7 @@ <h4 class="modal-title">Search results</h4>
<span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>

on 2018-11-06T21:04:11-05:00
on 2018-11-30T16:51:16-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 @@ -250,7 +250,7 @@ <h4 class="modal-title">Search results</h4>
<span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>

on 2018-11-06T21:04:10-05:00
on 2018-11-30T16:51:16-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 @@ -308,7 +308,7 @@ <h4 class="modal-title">Search results</h4>
<span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>

on 2018-11-06T21:04:11-05:00
on 2018-11-30T16:51:16-05:00

using the <a href="https://github.com/docstrap/docstrap">DocStrap template</a>.
</span>
Expand Down
4 changes: 2 additions & 2 deletions docs/lib_timer.js.html
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ <h1 class="page-title">Source: lib/timer.js</h1>
}

const data = {
created: Date.now()
created: created
, id: id
, payload: payload
, timer: null
Expand Down Expand Up @@ -643,7 +643,7 @@ <h4 class="modal-title">Search results</h4>
<span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>

on 2018-11-06T21:04:11-05:00
on 2018-11-30T16:51:16-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 @@ -148,7 +148,7 @@ <h4 class="modal-title">Search results</h4>
<span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>

on 2018-11-06T21:04:11-05:00
on 2018-11-30T16:51:16-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 @@ -200,7 +200,7 @@ <h4 class="modal-title">Search results</h4>
<span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>

on 2018-11-06T21:04:11-05:00
on 2018-11-30T16:51:16-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 @@ -277,7 +277,7 @@ <h4 class="modal-title">Search results</h4>
<span class="jsdoc-message">
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a>

on 2018-11-06T21:04:11-05:00
on 2018-11-30T16:51:16-05:00

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

0 comments on commit e365793

Please sign in to comment.