diff --git a/grpc/README.md b/grpc/README.md index b862b95..4c4c504 100644 --- a/grpc/README.md +++ b/grpc/README.md @@ -1,6 +1,6 @@ # grpc demo -* `TimeService` implents `get_time` RPC call. +* `TimeService` implements `get_time` RPC call. * `get_time` returns the current server time in string format. ## How to Run @@ -11,6 +11,11 @@ pip3 install -r requirements.txt ``` +1. (Optional) Generate the compiled files. + ```bash + python -m grpc_tools.protoc --proto_path=. --python_out=. --grpc_python_out=. time.proto + ``` + 1. Run Server in one terminal window: ```bash python3 server.py diff --git a/grpc/time.proto b/grpc/time.proto index 5281d41..ba05b4b 100644 --- a/grpc/time.proto +++ b/grpc/time.proto @@ -2,14 +2,14 @@ syntax = "proto3"; package time; service Time { - rpc GetTime (TimeRequest) returns (TimeReply) {} + rpc GetTime(TimeRequest) returns (TimeReply) {} } // Empty Request Message -message TimeRequest { -} +message TimeRequest {} // The response message containing the time message TimeReply { + // Message to return string message = 1; }