No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.
 
 
 
 
rpm-mcarman b9f7ec4306 First Commit hace 3 años
..
test First Commit hace 3 años
.npmignore First Commit hace 3 años
History.md First Commit hace 3 años
Makefile First Commit hace 3 años
Readme.md First Commit hace 3 años
component.json First Commit hace 3 años
index.js First Commit hace 3 años
package.json First Commit hace 3 años

Readme.md

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

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