Relative Content

Tag Archive for grpc-javagrpc-pythonfull-duplex

Is there a way to create the Python equivalent of the Java gRPC StreamObserver behavior?

I have a use case where the gRPC client (in Java) needs to communicate with a gRPC server (in Python). The communication must be async full duplex. For example, the server must be able to initiate communication with the client in addition to the normal use case of the client initiating communication with the server using an RPC call. It must be async because there is no guarantee of ordering of requests or of responses, so we’re using a session id to match requests to responses. On the server side, I can use the context within the handler method, but once that method returns, the context is closed and no writing can occur. Plus, this approach requires the client to send the first message.