Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nisaacson/renew
Execute an asyncronous function repeatedly until it completes or the max number of attempts are reached
https://github.com/nisaacson/renew
Last synced: about 1 month ago
JSON representation
Execute an asyncronous function repeatedly until it completes or the max number of attempts are reached
- Host: GitHub
- URL: https://github.com/nisaacson/renew
- Owner: nisaacson
- Created: 2013-04-19T00:40:49.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2013-04-19T01:15:31.000Z (over 11 years ago)
- Last Synced: 2024-04-14T14:46:49.391Z (7 months ago)
- Size: 422 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Renew
Execute an asyncronous function repeatedly until it completes or the max number of attempts are reached# Installation
```bash
npm -S install renew
```# Usage
```javascript
var renew = require('renew')
var inspect = require('eyespect').inspector();
var params = ['foo', 'params']
var command = function (data, cb) {
inspect(data, 'command called with params')
setTimeout(function () {
cb(null, 'foo result')
})
}var data = {
command: command,
params: params,
maxAttempts: 4
}
renew(data, function (err, reply) {})
```
# Test