popsicle-retry

Enable request retry for Popsicle

Apache-2.0 10 个版本
安装
npm install popsicle-retry
yarn add popsicle-retry
pnpm add popsicle-retry
bun add popsicle-retry
README

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

版本列表
4.1.0 2019-11-06
4.0.0 2019-06-09
3.2.1 2016-06-20
3.2.0 2016-06-15
3.1.0 2016-05-08
3.0.1 2016-05-08
3.0.0 2016-05-08
2.0.0 2016-04-04
1.0.1 2016-02-10
1.0.0 2016-02-10