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
> **TLDR; See the [example](./example/) directory**
Define an RPC service in a `schema.proto`.
```protobuf
message Echo {
syntax = "proto2";
message EchoMsg {
required string value = 1;
}
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.
You can write a simple server and client like so.
You can then write a async-ready server and client like so.
```python
# server.py
@ -43,7 +47,7 @@ You can write a simple server and client like so.
# 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