https://github.com/featurist/node-anticipate
retries asynchronous functions until they succeed
https://github.com/featurist/node-anticipate
Last synced: about 2 months ago
JSON representation
retries asynchronous functions until they succeed
- Host: GitHub
- URL: https://github.com/featurist/node-anticipate
- Owner: featurist
- Created: 2012-12-15T10:37:31.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2012-12-16T00:41:52.000Z (over 12 years ago)
- Last Synced: 2025-02-23T19:18:20.463Z (2 months ago)
- Language: JavaScript
- Size: 109 KB
- Stars: 1
- Watchers: 5
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# anticipate
Retries asynchronous functions until they succeed.
## Install
npm install anticipate
#### Example ([PogoScript](http://github.com/featurist/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) {
itWorked(result);
}, function(error) {
ohNoes(error);
});#### License
BSD