@@ -83,7 +83,7 @@ struct config {
8383 */
8484 std::optional<int > database_index = 0 ;
8585
86- // / Message used by the health-checker in @ref boost::redis::basic_connection::async_run .
86+ // / Message used by `PING` commands sent by the health checker .
8787 std::string health_check_id = " Boost.Redis" ;
8888
8989 /* *
@@ -105,7 +105,24 @@ struct config {
105105 std::chrono::steady_clock::duration ssl_handshake_timeout = std::chrono::seconds{10 };
106106
107107 /* * @brief Time span between successive health checks.
108- * Set to zero to disable health-checks pass zero as duration.
108+ * Set to zero to disable health-checks.
109+ *
110+ * When this value is set to a non-zero duration, @ref basic_connection::async_run
111+ * will issue `PING` commands whenever no command is sent to the server for more
112+ * than `health_check_interval`. You can configure the message passed to the `PING`
113+ * command using @ref health_check_id.
114+ *
115+ * Enabling health checks also sets timeouts to individual network
116+ * operations. The connection is considered dead if:
117+ *
118+ * @li No byte can be written to the server after `health_check_interval`.
119+ * @li No byte is read from the server after `2 * health_check_interval`.
120+ *
121+ * If the health checker finds that the connection is unresponsive, it will be closed,
122+ * and a reconnection will be triggered, as if a network error had occurred.
123+ *
124+ * The exact timeout values are *not* part of the interface, and might change
125+ * in future versions.
109126 */
110127 std::chrono::steady_clock::duration health_check_interval = std::chrono::seconds{2 };
111128
0 commit comments