Retrier
Simple operation retrier till callback success or max attempts are reached
var retry = ; var { console; return ;} ;
retrier(n, operation, callback);
Will call operation for n times untill it succeeds.
- n: count to call operation
- operation: single callback argument function (if you need args, check out async.apply, or function.bind)
- callback: final callback to be called with response or error if operation failed for n times
PR's are welcomed