Skip to main content
Module

x/retry/mod.ts

Re-execute a function until it does not throw an error or execute a function with a timeout.
Very Popular
Latest
import * as retry from "https://deno.land/x/retry@v2.0.0/mod.ts";

Functions

Returns the current retry options. To change default options, use setDefaultRetryOptions: do not try to modify this object

Type guard for TimeoutError

Retry a function until it does not throw an exception.

Retry an async function until it does not throw an exception.

Set default retry options

wait for a function to complete within a givne duration or throw an exception.

wait for a function to complete within a givne duration or throw an exception.

a waitUntilAsync decorator

a waitUntil decorator

Interfaces

Retry options:

  • maxTry: maximum number of attempts. if fn is still throwing execption afect maxtry attempts, an exepction is thrown
  • delay: number of miliseconds between each attempt.
  • until: if given, the function will be call until this function returns tru or until maxTry calls.