melledijkstra / python-grpc-chat

Chat application created with gRPC. This was a study for bidirectional gRPC streaming.
72 stars 30 forks source link

Not bidirectional streaming note #1

Open eufat opened 5 years ago

eufat commented 5 years ago

If it a bidirectional streaming system, the proto file should be like this:

service ChatServer {
    // This bi-directional stream makes it possible to send and receive Notes between 2 persons
    rpc ChatStream (stream Note) returns (stream Note);
}
melledijkstra commented 5 years ago

@eufat You are probably right, although I might have had issues doing it this way (don't remember though, been a while). Will look into it when I have time.

entrehuihui commented 3 years ago

run python -m grpc_tools.protoc -I=proto/ --python_out=proto/ --grpc_python_out=proto/ proto/chat.proto generate import chat_pb2 as chat__pb2. not from . import chat_pb2 as chat__pb2

jai-dewani commented 2 years ago

Yes, I am also having issues working with truly bidirectional streams with gRPC in python.
Especially having problem running two separate async loops for getting messages and sending messages in a single method