renew
v0.0.1
Published
Execute an asyncronous function repeatedly until it completes or the max number of attempts are reached
Readme
Renew
Execute an asyncronous function repeatedly until it completes or the max number of attempts are reached
Installation
npm -S install renewUsage
var renew = require('renew')
var inspect = require('eyespect').inspector();
var params = ['foo', 'params']
var command = function (data, cb) {
inspect(data, 'command called with params')
setTimeout(function () {
cb(null, 'foo result')
})
}
var data = {
command: command,
params: params,
maxAttempts: 4
}
renew(data, function (err, reply) {
})
