Bones/node_modules/popsicle-retry
SOUTHERNCO\x2mjbyrn 7efe7605b8 Template Upload
2017-05-17 13:45:25 -04:00
..
dist Template Upload 2017-05-17 13:45:25 -04:00
LICENSE Template Upload 2017-05-17 13:45:25 -04:00
package.json Template Upload 2017-05-17 13:45:25 -04:00
README.md Template Upload 2017-05-17 13:45:25 -04:00
typings.json Template Upload 2017-05-17 13:45:25 -04:00

Popsicle Retry

NPM version NPM downloads Build status Test coverage

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