Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 
 
 
rpm-mcarman b9f7ec4306 First Commit il y a 3 ans
..
test First Commit il y a 3 ans
.npmignore First Commit il y a 3 ans
History.md First Commit il y a 3 ans
Makefile First Commit il y a 3 ans
Readme.md First Commit il y a 3 ans
component.json First Commit il y a 3 ans
index.js First Commit il y a 3 ans
package.json First Commit il y a 3 ans

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