Template Upload

This commit is contained in:
SOUTHERNCO\x2mjbyrn
2017-05-17 13:45:25 -04:00
parent 415b9c25f3
commit 7efe7605b8
11476 changed files with 2170865 additions and 34 deletions

1
node_modules/backo2/.npmignore generated vendored Normal file
View File

@ -0,0 +1 @@
node_modules/

12
node_modules/backo2/History.md generated vendored Normal file
View File

@ -0,0 +1,12 @@
1.0.1 / 2014-02-17
==================
* go away decimal point
* history
1.0.0 / 2014-02-17
==================
* add jitter option
* Initial commit

8
node_modules/backo2/Makefile generated vendored Normal file
View File

@ -0,0 +1,8 @@
test:
@./node_modules/.bin/mocha \
--require should \
--reporter dot \
--bail
.PHONY: test

34
node_modules/backo2/Readme.md generated vendored Normal file
View File

@ -0,0 +1,34 @@
# backo
Simple exponential backoff because the others seem to have weird abstractions.
## Installation
```
$ npm install backo
```
## Options
- `min` initial timeout in milliseconds [100]
- `max` max timeout [10000]
- `jitter` [0]
- `factor` [2]
## Example
```js
var Backoff = require('backo');
var backoff = new Backoff({ min: 100, max: 20000 });
setTimeout(function(){
something.reconnect();
}, backoff.duration());
// later when something works
backoff.reset()
```
# License
MIT

11
node_modules/backo2/component.json generated vendored Normal file
View File

@ -0,0 +1,11 @@
{
"name": "backo",
"repo": "segmentio/backo",
"dependencies": {},
"version": "1.0.1",
"description": "simple backoff without the weird abstractions",
"keywords": ["backoff"],
"license": "MIT",
"scripts": ["index.js"],
"main": "index.js"
}

85
node_modules/backo2/index.js generated vendored Normal file
View File

@ -0,0 +1,85 @@
/**
* Expose `Backoff`.
*/
module.exports = Backoff;
/**
* Initialize backoff timer with `opts`.
*
* - `min` initial timeout in milliseconds [100]
* - `max` max timeout [10000]
* - `jitter` [0]
* - `factor` [2]
*
* @param {Object} opts
* @api public
*/
function Backoff(opts) {
opts = opts || {};
this.ms = opts.min || 100;
this.max = opts.max || 10000;
this.factor = opts.factor || 2;
this.jitter = opts.jitter > 0 && opts.jitter <= 1 ? opts.jitter : 0;
this.attempts = 0;
}
/**
* Return the backoff duration.
*
* @return {Number}
* @api public
*/
Backoff.prototype.duration = function(){
var ms = this.ms * Math.pow(this.factor, this.attempts++);
if (this.jitter) {
var rand = Math.random();
var deviation = Math.floor(rand * this.jitter * ms);
ms = (Math.floor(rand * 10) & 1) == 0 ? ms - deviation : ms + deviation;
}
return Math.min(ms, this.max) | 0;
};
/**
* Reset the number of attempts.
*
* @api public
*/
Backoff.prototype.reset = function(){
this.attempts = 0;
};
/**
* Set the minimum duration
*
* @api public
*/
Backoff.prototype.setMin = function(min){
this.ms = min;
};
/**
* Set the maximum duration
*
* @api public
*/
Backoff.prototype.setMax = function(max){
this.max = max;
};
/**
* Set the jitter
*
* @api public
*/
Backoff.prototype.setJitter = function(jitter){
this.jitter = jitter;
};

69
node_modules/backo2/package.json generated vendored Normal file
View File

@ -0,0 +1,69 @@
{
"_args": [
[
"backo2@1.0.2",
"C:\\Users\\x2mjbyrn\\Source\\Repos\\Skeleton\\node_modules\\socket.io-client"
]
],
"_from": "backo2@1.0.2",
"_id": "backo2@1.0.2",
"_inCache": true,
"_location": "/backo2",
"_npmUser": {
"email": "mokesmokes@gmail.com",
"name": "mokesmokes"
},
"_npmVersion": "1.4.28",
"_phantomChildren": {},
"_requested": {
"name": "backo2",
"raw": "backo2@1.0.2",
"rawSpec": "1.0.2",
"scope": null,
"spec": "1.0.2",
"type": "version"
},
"_requiredBy": [
"/socket.io-client"
],
"_resolved": "https://registry.npmjs.org/backo2/-/backo2-1.0.2.tgz",
"_shasum": "31ab1ac8b129363463e35b3ebb69f4dfcfba7947",
"_shrinkwrap": null,
"_spec": "backo2@1.0.2",
"_where": "C:\\Users\\x2mjbyrn\\Source\\Repos\\Skeleton\\node_modules\\socket.io-client",
"bugs": {
"url": "https://github.com/mokesmokes/backo/issues"
},
"dependencies": {},
"description": "simple backoff based on segmentio/backo",
"devDependencies": {
"mocha": "*",
"should": "*"
},
"directories": {},
"dist": {
"shasum": "31ab1ac8b129363463e35b3ebb69f4dfcfba7947",
"tarball": "https://registry.npmjs.org/backo2/-/backo2-1.0.2.tgz"
},
"gitHead": "3e695bade7756fef2295e8883bf3570a06e5d9ec",
"homepage": "https://github.com/mokesmokes/backo",
"installable": true,
"keywords": [
"backoff"
],
"license": "MIT",
"maintainers": [
{
"name": "mokesmokes",
"email": "mokesmokes@gmail.com"
}
],
"name": "backo2",
"optionalDependencies": {},
"repository": {
"type": "git",
"url": "https://github.com/mokesmokes/backo"
},
"scripts": {},
"version": "1.0.2"
}

18
node_modules/backo2/test/index.js generated vendored Normal file
View File

@ -0,0 +1,18 @@
var Backoff = require('..');
var assert = require('assert');
describe('.duration()', function(){
it('should increase the backoff', function(){
var b = new Backoff;
assert(100 == b.duration());
assert(200 == b.duration());
assert(400 == b.duration());
assert(800 == b.duration());
b.reset();
assert(100 == b.duration());
assert(200 == b.duration());
})
})