Open sagaxu opened 2 months ago
It's nice to use ping command to check if the connection is still alive.
https://github.com/vert-x3/vertx-redis-client/blob/e3731a3e8a4d61beb4d2e03a223621a7c7252af2/src/main/java/io/vertx/redis/client/impl/RedisStandaloneConnection.java#L378
private class ChannelReadStream<T>(val stream: ReadStream<T>, val channel: Channel<T>, context: Context) : Channel<T> by channel, CoroutineScope { override val coroutineContext: CoroutineContext = context.dispatcher() fun subscribe() { stream.endHandler { close() } stream.exceptionHandler { err -> close(err) } stream.handler { event -> launch { send(event) stream.fetch(1) } } } }
It's nice to use ping command to check if the connection is still alive.
https://github.com/vert-x3/vertx-redis-client/blob/e3731a3e8a4d61beb4d2e03a223621a7c7252af2/src/main/java/io/vertx/redis/client/impl/RedisStandaloneConnection.java#L378