In Reactor we expose connection events like close (e.g. for removing a reference to a connection from other resources when the connection is closed by the remote peer) as well as readIdle and writeIdle for determining when we need to send pings if a connection has been idle for a given amount of time.
In supporting close, we need to be sure to expose that in a way that makes it easy to do reconnects to arbitrary hosts so that if a connection to one host is dropped, the close listener has the appropriate scope and is able to perform another connect to either the first host or a different one if a list of possible hosts is given. In Reactor we strategize the reconnect so it's possible to do incremental backoff and other types of reconnection (like abandoning the reconnect effort).
In Reactor we expose connection events like
close
(e.g. for removing a reference to a connection from other resources when the connection is closed by the remote peer) as well asreadIdle
andwriteIdle
for determining when we need to send pings if a connection has been idle for a given amount of time.In supporting close, we need to be sure to expose that in a way that makes it easy to do reconnects to arbitrary hosts so that if a connection to one host is dropped, the close listener has the appropriate scope and is able to perform another connect to either the first host or a different one if a list of possible hosts is given. In Reactor we strategize the reconnect so it's possible to do incremental backoff and other types of reconnection (like abandoning the reconnect effort).