Closed akshaymankar closed 3 years ago
Testing a simple service defined like this:
syntax = "proto3"; package mu.grpc.test; message GreetingRequest {string name = 1; } message GreetingResponse {string greeting = 1;} service GreetingsService { rpc bidirectional (stream GreetingRequest) returns (stream GreetingResponse); }
The bidirectional function is implemented like this:
bidirectional :: forall m. (MonadServer m, MonadIO m) => ConduitT () GreetingRequest m () -> ConduitT GreetingResponse Void m () -> m () bidirectional requests responses = do C.runConduit $ requests .| serveResponse .| responses liftIO $ putStrLn "Done!" where serveResponse :: ConduitT GreetingRequest GreetingResponse m () serveResponse = do liftIO $ putStrLn "Server Waiting" mreq <- C.await case mreq of Nothing -> pure () Just req -> do C.yield $ record1 $ "Greetings! " <> view #name req serveResponse
While testing with evans, I get this error at the end:
command call: failed to process bidi streaming RPC: rpc error: code = Internal desc = AsyncCancelled
Another thing to note is that "Done!" is never printed. So, it looks like the requests conduit never realises that the input is over.
"Done!"
requests
Testing a simple service defined like this:
The bidirectional function is implemented like this:
While testing with evans, I get this error at the end:
Another thing to note is that
"Done!"
is never printed. So, it looks like therequests
conduit never realises that the input is over.