Latest Tech News

Stay updated with the latest in technology, AI, cybersecurity, and more

Filtered by: retry Clear Filter

Retry Loop Retry

Retry Loop Retry Some time ago I lamented that I don’t know how to write a retry loop such that: it is syntactically obvious that the amount of retries is bounded, there’s no spurious extra sleep after the last attempt, the original error is reported if retrying fails, there’s no code duplication in the loop. https://matklad.github.io/2023/12/21/retry-loop.html To recap, we have fn action () E ! T { ... } fn is_transient_error (err: E) bool { ... } and we need to write fn action_with_r

Modelling API rate limits as diophantine inequalities

modelling API rate limits as diophantine inequalities You're allowed 10 requests per hour. Each task you run makes three attempts: initial call, retry after 10 minutes, and retry after 30 minutes. What’s the maximum number of tasks you can safely run per hour? Most engineers throw exponential backoff at the problem. And it works great in most cases! But can we, for the sake of having fun, be more mathematical about this? In a way, this is just an integer feasibility problem. the setup Let’

Topics: 10 30 retry task window