@sosimple/retry
TypeScript icon, indicating that this package has built-in type declarations

0.1.0 • Public • Published

Retry (API Doc)

A library for retrying failed I/O operations.

Example:

import { retry, fixedDelay } from "@sosimple/retry";

class MyService {

  @retry({
    // Fail after three attempts.
    retryLimit: 3,
    // Fail if attempts take more than three seconds.
    timeLimit: 3000,
    // Delay for 100 milliseconds between attempts.
    delayer: fixedDelay(100),
  })
  async makeNetworkRequest(): Promise<void> {
    // The @retry(...) annotation will call this method
    // as long as it throws exceptions, then returns
    // the last successful result.
  }
}

/@sosimple/retry/

    Package Sidebar

    Install

    npm i @sosimple/retry

    Weekly Downloads

    13

    Version

    0.1.0

    License

    MIT

    Unpacked Size

    30.4 kB

    Total Files

    33

    Last publish

    Collaborators

    • aradzie-user