开发者

Ruby: Increase time before timeout?

I'm trying to do the following:

remote_feed = open(url)

But the remote feed t开发者_StackOverflowakes a while to return, and the call times out. I just need to increase the time until timeout occurs, is there a simple way to do this in ruby?

Thanks!


require 'open-uri'

open('http://stackoverflow.com', 'r', :read_timeout=>0.01) do |http|
  http.read
end
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜