Background Jobs

Retry & Timeout

Retry with backoff and timeout utilities.

1 min readDocumentationEdit this page

Retry#

typescript
import { retry } from '@AxilJS/circuit'
 
const data = await retry(() => fetchAPI(), {
  attempts: 3,
  delay: 1000,
  backoff: 'exponential'
})

Timeout#

typescript
import { withTimeout } from '@AxilJS/circuit'
 
const result = await withTimeout(fetch(url), 5000, 'Request timed out')

Help improve the documentation

AxilJS is open source and documentation improvements are welcome.

AxilJS DocumentationMIT License · Built by SyntaxilitY