arnaucube
arnaucube/socketioMEANseedPublic Self-hosted repository
socketioMEANseed/server/node_modules/backo2/Readme.md
server/node_modules/backo2/Readme.mdRaw
 1# backo
 2
 3  Simple exponential backoff because the others seem to have weird abstractions.
 4
 5## Installation
 6
 7```
 8$ npm install backo
 9```
10
11## Options
12
13 - `min` initial timeout in milliseconds [100]
14 - `max` max timeout [10000]
15 - `jitter` [0]
16 - `factor` [2]
17
18## Example
19
20```js
21var Backoff = require('backo');
22var backoff = new Backoff({ min: 100, max: 20000 });
23
24setTimeout(function(){
25  something.reconnect();
26}, backoff.duration());
27
28// later when something works
29backoff.reset()
30```
31
32# License
33
34  MIT