popsicle-retry
TypeScript icon, indicating that this package has built-in type declarations

4.1.0 • Public • Published

Popsicle Retry

NPM version NPM downloads Build status Test coverage

Enable request retry for Popsicle.

Installation

npm install popsicle-retry --save

Usage

import { retry } from "popsicle-retry";
 
const send = retry(transport);
const res = await send(req);

Methods

  • retry(fn, shouldRetry?) Wraps a request function with retry support. Accepts a second function that returns a delay, or -1 (default is retries()).
  • retryAllowed(error?, request?) Check if a request should be retried. Defaults to 5xx and unavailable errors.
  • retries(count?, isRetryAllowed?) An exponential back-off function, defaulting to 3 retries.

License

Apache 2.0

Package Sidebar

Install

npm i popsicle-retry

Weekly Downloads

58,608

Version

4.1.0

License

Apache-2.0

Unpacked Size

15.5 kB

Total Files

9

Last publish

Collaborators

  • blakeembrey