.. | ||
dist | ||
LICENSE | ||
package.json | ||
README.md | ||
typings.json |
Popsicle Retry
Enable request retries for Popsicle (>= 3.2).
Installation
npm install popsicle-retry --save
Usage
var request = require('popsicle').request
var retry = require('popsicle-retry')
request('http://example.com')
.use(retry())
.then(...)
Options
Accepts a function that returns a number of milliseconds to back off for, or -1
. Defaults to popsicleRetry.retries(5, retryAllowed)
.
Methods
- retryAllowed(request) Check if a request should be attempted again. Defaults to
5xx
and unavailable errors. - retries(count, isRetryAllowed) An exponential backoff function, defaulting to 5 retries.
License
Apache 2.0