Ruby 线程超时的合理时间长度是多少?

发布于 2024-12-19 22:05:06 字数 84 浏览 3 评论 0原文

我需要保留数据并让 Ruby 程序等待几天的响应。我正在考虑使用线程来实现这一点(网络上可能有许多并发请求)。我的问题;让线程运行几天以等待响应是否合理?

I've got a need to retain the data and keep a Ruby program waiting for a response for anything up to a couple of days. I'm thinking about implementing this using threads (there may be a number of concurrent requests across a network). My question; is it reasonable to leave a thread running for anything up to a couple of days awaiting a response?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

—━☆沉默づ 2024-12-26 22:05:06

一般来说,这是没有问题的。查看 Queue 类,它可能有助于“作业轮询”:

http://www.ruby-doc.org/stdlib-1.8.7/libdoc/thread/rdoc/Queue.html

In general there is no problem with that. Check out the Queue class, it might facilitate the "job polling":

http://www.ruby-doc.org/stdlib-1.8.7/libdoc/thread/rdoc/Queue.html

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文