The way in that the server response stream is is sent with a "pull API" rather than "push API" indeed prevents e.g. detecting failed writes from the application's stream handler. Is is possible to continuously read from the "requests from client stream" enumerable on the server - that "requests enumerable" will terminate when (among other possible reasons) the call is cancelled.
On Friday, July 6, 2018 at 11:54:57 AM UTC-7, jdw...@gmail.com wrote: > > 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 > > -- You received this message because you are subscribed to the Google Groups "grpc.io" group. To unsubscribe from this group and stop receiving emails from it, send an email to grpc-io+unsubscr...@googlegroups.com. To post to this group, send email to grpc-io@googlegroups.com. Visit this group at https://groups.google.com/group/grpc-io. To view this discussion on the web visit https://groups.google.com/d/msgid/grpc-io/fca2874a-d576-4816-bb7d-ec6b35dfa353%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.