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§
- Retryable
Error - One attempt’s outcome for
retry_rate_limited, returned by the caller’s per-attempt closure.
Functions§
- retry_
rate_ limited - Runs
attemptuntil it returnsOk, returns aRetryableError::Fatal, or exhaustsmax_retriesretries after repeatedRetryableError::RateLimitedoutcomes.