Fix example, add TLDR and fixup copy

This commit is contained in:
Luke Murphy 2020-08-09 02:52:29 +02:00
parent 0425f791c7
commit 78a0e25fe5
No known key found for this signature in database
GPG Key ID: 5E2EF5A63E3718CC
1 changed files with 8 additions and 4 deletions

View File

@ -12,15 +12,19 @@ $ pip install hrpc
## Example ## Example
> **TLDR; See the [example](./example/) directory**
Define an RPC service in a `schema.proto`. Define an RPC service in a `schema.proto`.
```protobuf ```protobuf
message Echo { syntax = "proto2";
message EchoMsg {
required string value = 1; required string value = 1;
} }
service Example { service Example {
rpc Echo (Echo) returns (Echo) {} rpc Echo (EchoMsg) returns (EchoMsg) {}
} }
``` ```
@ -33,7 +37,7 @@ $ hrpc schema.proto
This creates `schema_gprc.py` (services) and `schema_pb2.py` (stubs) files. This creates `schema_gprc.py` (services) and `schema_pb2.py` (stubs) files.
You can write a simple server and client like so. You can then write a async-ready server and client like so.
```python ```python
# server.py # server.py
@ -43,7 +47,7 @@ You can write a simple server and client like so.
# client.py # client.py
``` ```
Then run them in separate terminals and see the output. And run them in separate terminals to see the output.
``` ```
$ python server.py # terminal 1 $ python server.py # terminal 1