Flood
🌊 Flood a network with requests in batches with retries.
Usage
npm i -S @joemccann/flood
const flood = require('@joemccann/flood')
const data = {
batchSize: 50,
done: (data) => {
},
errorHandler: (e, results) => {
console.error(e)
},
sleepTime: 100,
url: `http://localhost:8080/api/foo?id={iteration}`,
values: ['a','b','c']
}
try{
const { data, err } = await flood(data)
console.dir(data)
} catch(e) {
console.error(e)
}
NOTE: The retries will go on forever so be wise about how you handle the errors.
Tests
npm i -D
npm test
Authors
LICENSE
MIT