betolerant

0.1.1 • Public • Published

betolerant

NPM Version Build Status

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
});

/betolerant/

    Package Sidebar

    Install

    npm i betolerant

    Weekly Downloads

    0

    Version

    0.1.1

    License

    MIT

    Last publish

    Collaborators

    • zf