I have a Ruby server. I want to stream the same information to many clients.
Clients call my server streamer, I add their Enum to a list.
When I want to broadcast I go through the list of enums and push something into their queue. This all works well.
When a client goes away however, I'm having trouble detecting that and removing them from my list.
My thought was to use keepalive, and hope that I would be able to detect that the _call's associated with the streams would be `cancelled?` once the server has disconnected them.
Just for testing I have set keepalive quite short.
server_args = {
"grpc.keepalive_time_ms" => 4000,
"grpc.keepalive_timeout_ms" => 4000,
"grpc.keepalive_permit_without_calls" => 0,
"grpc.http2.min_time_between_pings_ms" => 4000,
"grpc.max_connection_age_ms" => 4000, "grpc.max_connection_age_grace_ms" => 2000,
"grpc.max_connection_idle_ms" => 4000
}
s = GRPC::RpcServer.new(pool_size: 1024,
max_waiting_requests: 1024,
server_args: server_args,
interceptors: interceptors)
Configured like this, I do see the client receive GO_AWAY but in the ruby server I'm not at all sure how to detect that these connections are kaput.
Any ideas / thoughts?
-Jeff