elixir-grpc / grpc

An Elixir implementation of gRPC
https://hex.pm/packages/grpc
Apache License 2.0
1.39k stars 212 forks source link

Make server stream work with mint client and add keepalive. #352

Open nulian opened 7 months ago

nulian commented 7 months ago

This is what I been using for a while in our application.

Changed connection open? check to :read so server streaming is seen as a valid state for the connection.

And added a keepalive to make sure the connection is still open of the server stream because if a service like nginx breaks the connection you won't get any notification so you will never close the connection even if it's already broken.

Also added some error handling cases so it won't cause any server errors.

312

polvalente commented 6 months ago

@nulian did you get a chance to act on the reviews?