0.1.1 • Published 7 years ago
betolerant v0.1.1
betolerant
let betolerant = require("betolerant");
betolerant(3 /*tries*/, 10000 /*timeout*/, function* {
yield asyncOp();
yield sleep(1000);
result = yield checkAsyncOpResult();
if (!result.failed) {
throw Error("op failed");
}
}).then(function(){
// done;
}).catch(function(){
// all three attemps timed out or failed
});