
Web
Retries and Backoff for the Go HTTP Client Done Safely
Add retries to a Go HTTP client as a RoundTripper with exponential backoff and jitter, Retry-After, body replay and a rule for which requests are safe.
9 min read
Goroutines are cheap to start and expensive to get wrong. Channels, mutexes, context and the leaks and deadlocks waiting for anyone who skips the details.

Add retries to a Go HTTP client as a RoundTripper with exponential backoff and jitter, Retry-After, body replay and a rule for which requests are safe.

Rate limit a Go API per key and per route with token buckets: weighted costs, 429 with Retry-After, idle sweeping, a fake test clock and 123 ns decisions.
We send one email when a new article is published. No spam.