Naively Programmable Module
    Have ideas to improve npm?Join in the discussion! »

    anticipate

    0.0.2 • Public • Published

    anticipate

    Retries asynchronous functions until they succeed.

    Install

    npm install anticipate

    Example (PogoScript)

    anticipate = require 'anticipate'
    
    anticipate.trying @(callback)
        something unreliable (callback)
    every 0.1 seconds for 3 tries @(result)
        it worked (result)
    else @(error)
        oh noes (error)
    

    Example (JavaScript)

    anticipate = require('anticipate');
    
    anticipate.tryingEverySecondsForTriesElse(function(callback) {
        somethingUnreliable(callback);
    }, 0.1, 3, function(result) {
        return itWorked(result);
    }, function(error) {
        return ohNoes(error);
    });
    

    License

    BSD

    Keywords

    none

    Install

    npm i anticipate

    DownloadsWeekly Downloads

    1

    Version

    0.0.2

    License

    BSD

    Last publish

    Collaborators

    • avatar