Loading…
|
Translation changed |
|
|
String added in the repository |
|
Loading…
|
Translation changed |
|
|
String added in the repository |
|
When a timeout is set, it cancels any previous read or write timeout for which no outstanding operation is in progress. Algorithms which loop over logical operations simply need to set the timeout once before the logical operation, it is not necessary to call `expires_never` in this case. Here we implement an algorithm which continuously echoes lines back, with a timeout. This example is implemented as a complete function.当设置超时时,会取消之前尚未有未完成操作正在进行的读写超时。对于循环执行逻辑操作的算法,只需在执行逻辑操作之前设置一次超时,这种情况下无需调用 `expires_never`。以下示例实现一个持续回显行数据并带有超时机制的算法,该示例作为一个完整函数提供。