神经超时意味着什么?

What does the timeout in nerve signify?

我正在尝试使用 nerve 发现一些服务。

虽然我遇到了神经docs中指定的超时配置

timeout: (optional) maximum time the check can take; defaults to 100ms

然而,当我查看提供的 examples 时,超时被称为“0.2”。

这是否意味着这些示例的超时是“0.2ms”?这甚至是超时的有效配置吗? 或者 0.2 被认为是 2 sec?

我检查了 nerve 的代码,看起来 nerve json 中提供的超时配置只是读取这个值并直接将它作为 read_timeout 传递给 http client 而没有任何额外处理。

根据 Ruby 文档,此值以秒为单位。
所以 0.2 表示 200 毫秒。

我假设 Nerve Docs 没有更新或 w.r.t 文档有误。

read_timeout[R]
Number of seconds to wait for one block to be read (via one read(2) call). Any number may be used, including Floats for fractional seconds. If the HTTP object cannot read data in this many seconds, it raises a Net::ReadTimeout exception. The default value is 60 seconds.