higherkindness / mu-haskell

Mu (μ) is a purely functional framework for building micro services.
http://higherkindness.io/mu-haskell/
Apache License 2.0
333 stars 19 forks source link

[grpc-client] Handle bidirectional streams correctly #314

Closed akshaymankar closed 3 years ago

akshaymankar commented 3 years ago

This is a breaking change: The handler for bidirectional streams is returns two conduits now, instead of one. This enables the client to correctly tackle the concurrent nature of the client to server stream and the server to client stream.

Each response in the server-to-client stream is no longer wrapped in GRpcReply, any error during parsing the stream is thrown in IO.

Other connection related errors are returned in the result value of the conduit corresponding to the server-to-client Conduit.

Note: The client didn't and still doesn't handle any errors that the server might indicate using headers or trailers, e.g. grpc-status or the HTTP status code. This PR also adds TODO comments to handle these.

Fixes #313