README
anticipate
Retries asynchronous functions until they succeed.
Install
npm install anticipate
PogoScript)
Example (anticipate = require 'anticipate'
anticipate.trying @(callback) every 0.1 seconds
something flaky with (callback)
.succeeds within 10 tries @(result)
it worked (result)
.otherwise @(error)
oh noes (error)
Example (JavaScript)
anticipate = require('anticipate');
anticipate.tryingEverySeconds(function(callback) {
somethingFlakyWith(callback);
}, 0.1).succeedsWithinTries(10, function(result) {
itWorked(result);
}).otherwise(function(error) {
ohNoes(error);
});
License
BSD