From 75de5c54ced0c93b1194433d35b142c2d602e40e Mon Sep 17 00:00:00 2001 From: xiehan <52160700+Barenboim@users.noreply.github.com> Date: Tue, 28 Nov 2023 16:43:56 +0800 Subject: [PATCH] Update about-timeout.md --- docs/en/about-timeout.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/en/about-timeout.md b/docs/en/about-timeout.md index af806bbb..5daf6e94 100644 --- a/docs/en/about-timeout.md +++ b/docs/en/about-timeout.md @@ -110,6 +110,7 @@ public: void set_send_timeout(int timeout) { this->send_timeo = timeout; } void set_receive_timeout(int timeout) { this->receive_timeo = timeout; } void set_keep_alive(int timeout) { this->keep_alive_timeo = timeout; } + void set_watch_timeout(int timeout) { this->watch_timeo = timeout; } ... } ~~~ @@ -123,6 +124,8 @@ In the above code, **set\_send\_timeout()** sets the timeout for sending a compl When an HTTP protocol is used, if a client or a server wants to use short connection, you can add an HTTP header to support it. Please do not modify it with this interface if you have other options. If a Redis client wants to close the connection after a request, you need to use this interface. Obviously, **set\_keep\_alive()** is invalid in the callback (the connection has been reused). +**set\_watch\_timeout()** is specific for client task only. It indicate the maximum time of waiting the first response package. This may prevent the client task from being timed out by the limit of **response\_timeout** and **receive\_timeout**. The framework will caculate **receive\_timeoout** after receiving the first package if **watch\_timeout** is set. + ### Timeout for synchronous task waiting There is a very special timeout configuration, and it is the only global synchronous waiting timeout. It is not recommended, but you can get good results with it in some application scenarios.