Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我的 Web 请求时不时地失败,但是我的应用程序确实需要服务提供的数据。
重新发送请求的最佳模式是什么?
我知道如果我只是无限期地直接尝试,级联会出现问题。
我在 PHP 中使用 cURL 库
Google 使用的算法会在 2^retrycount 秒后尝试。我认为这是一个很好的算法,但是如果您现在需要信息,请尝试缓存答案并使用缓存,直到资源再次可用。如果可以等那么久,我会推荐谷歌算法。