1.0.0 • Published 6 years ago
backoff-time v1.0.0
backoff-time
Zero deps backoff time function
Install
$ npm install backoff-time
Usage
const minBackoff = 50;
const maxBackoff = 5000;
const backoff = require('backoff-time')(minBackoff, maxBackoff);
var attempt = 0;
function blah(...){
}
// every time blah fails we increment *attempt*
const wait = backoff(attempt);
// retry
setTimeout(fn, wait);
1.0.0
6 years ago