Skip to main content

Module retry

Module retry 

Source
Expand description

Rate-limit-aware retry for edge platform REST clients (#795).

Every edge’s *_api.rs dials a platform REST API (Slack, Telegram, …) that can answer a write with a rate-limit signal — an HTTP 429, usually paired with a Retry-After header or an equivalent body-level field. Before this module, no client recognized that signal: a rate-limited chat.postMessage or an approval-card chat.update just surfaced as an ordinary API error and the reply (or the approval-card edit) was silently dropped.

retry_rate_limited is the one shared loop every *_api.rs wraps its attempt in. The caller decides, per attempt, whether the platform’s response means “done” or “rate limited, wait this long” — this module only owns the wait-and-retry mechanics, since each platform signals a rate limit differently (status code, header, or JSON body field).

Enums§

RetryableError
One attempt’s outcome for retry_rate_limited, returned by the caller’s per-attempt closure.

Functions§

retry_rate_limited
Runs attempt until it returns Ok, returns a RetryableError::Fatal, or exhausts max_retries retries after repeated RetryableError::RateLimited outcomes.