A library for retrying calls to the Internet Computer with configurable retry policies.
This library provides utilities for retrying calls to the Internet Computer with different retry policies. It supports both idempotent and non-idempotent calls, though you must decide yourself which calls are idempotent and which are not.
Note that retries are always executed immediately, there is no backoff strategy. This is because the Internet Computer doesn't (yet?) support "pausing" a call context. Retries with backoffs would have to be implemented as background tasks.
Features
- Support for both idempotent and non-idempotent calls
- Configurable retry policies with deadlines
- Detailed error reporting
Examples
use ;
use time;
use Call;
async
Note
Retrying indefinitely is not recommended, as this can make your canister unupgradable. For example, the following are safe to use:
- A time-based deadline (
Deadline::TimeOrStopping) - A stopping-based deadline (
Deadline::Stopping) - A maximum number of retries (
max_retries)