Modules@robinpath/retry
@robinpath/retry
0.1.0PublicRetry with exponential backoff and circuit breaker for RobinPath
@robinpath/retry
Retry with exponential backoff and circuit breaker patterns for resilient automation workflows
Why use this module?
The retry module lets you:
- Execute a function with automatic retry and exponential backoff
- Calculate the delay for a given retry attempt using exponential backoff
- Check if an HTTP status code is retryable (408, 429, 500, 502, 503, 504)
- Wait for a specified number of milliseconds
- Preview the delay schedule for a series of retry attempts
All functions are callable directly from RobinPath scripts with a simple, consistent API.
Installation
npm install @robinpath/retry
Quick Start
No credentials needed — start using it right away:
retry.withBackoff 3 1000 2 30000
Available Functions
| Function | Description |
|---|---|
retry.execute | Execute a function with automatic retry and exponential backoff |
retry.withBackoff | Calculate the delay for a given retry attempt using exponential backoff |
retry.isRetryable | Check if an HTTP status code is retryable (408, 429, 500, 502, 503, 504) |
retry.delay | Wait for a specified number of milliseconds |
retry.attempts | Preview the delay schedule for a series of retry attempts |
retry.createBreaker | Create a named circuit breaker with a failure threshold and reset timeout |
retry.breakerState | Get the current state of a named circuit breaker |
retry.breakerRecord | Record a success or failure in a circuit breaker |
retry.breakerAllow | Check if a circuit breaker allows requests through |
retry.breakerReset | Reset a circuit breaker to closed state |
Examples
Calculate the delay for a given retry attempt using exponential backoff
retry.withBackoff 3 1000 2 30000
Check if an HTTP status code is retryable (408, 429, 500, 502, 503, 504)
retry.isRetryable 503
Wait for a specified number of milliseconds
retry.delay 2000
Integration with RobinPath
import { RobinPath } from "@wiredwp/robinpath";
import Module from "@robinpath/retry";
const rp = new RobinPath();
rp.registerModule(Module.name, Module.functions);
rp.registerModuleMeta(Module.name, Module.functionMetadata);
const result = await rp.executeScript(`
retry.withBackoff 3 1000 2 30000
`);
Full API Reference
See MODULE.md for complete documentation including all parameters, return types, error handling, and advanced examples.
Related Modules
@robinpath/json— JSON module for complementary functionality
License
MIT
Versions (1)
| Version | Tag | Published |
|---|---|---|
| 0.1.0 | latest | yesterday |
Related Modules
devops
0
@robinpath/bitbucket
v0.1.1robinpath
Bitbucket module for RobinPath.
0 downloads
...
devops
0
@robinpath/box
v0.1.1robinpath
Box module for RobinPath.
0 downloads
...
devops
0
@robinpath/cache
v0.1.1robinpath
In-memory key-value cache with optional TTL expiration for temporary data storage
0 downloads
...
devops
0
@robinpath/cloudflare
v0.1.1robinpath
Cloudflare module for RobinPath.
0 downloads
...
Install
$ robinpath install @robinpath/retry Version0.1.0
LicenseMIT
Unpacked Size5.7 KB
Versions1
Weekly Downloads0
Total Downloads0
Stars0
Last Publishyesterday
Createdyesterday

