reactive-ipc / reactive-ipc-jvm

Reactive IPC for the JVM
Apache License 2.0
55 stars 13 forks source link

Handling IO events like close, readIdle, and writeIdle #29

Open jbrisbin opened 9 years ago

jbrisbin commented 9 years ago

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).