当我在发出Typhoeus请求时指定超时时,该超时是连接超时还是下载超时?如果是连接超时,有没有办法指定下载超时?
示例:
Typhoeus::Request.new(url, **:timeout => 3000**, :followlocation => true)
答案 0 :(得分:2)
看起来Typhoeus README自原始帖子/答案以来已经更新。
https://github.com/typhoeus/typhoeus#timeouts
div
和timeout
。connecttimeout
是整个请求的时间限制 ,以秒为单位 。timeout
是连接阶段的时间限制,再次 以秒为单位 。
还有两个更细粒度的选项connecttimeout
和timeout_ms
,但只有在使用异步解析器编译connecttimeout_ms
时才支持以ms为单位的超时。
答案 1 :(得分:1)
这可能取决于您使用的版本。由于Typhoeus 0.5就是这样:libcurl timeout。哪个应该包括转移。与libcurl connect timeout比较。