hrpc/example
Luke Murphy 1f61e86cba
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
Clean up example
2020-08-09 03:53:39 +02:00
..
client.py Clean up example 2020-08-09 03:53:39 +02:00
greeter_grpc.py Add a complete greeter example 2020-08-09 03:35:01 +02:00
greeter_pb2.py Add a complete greeter example 2020-08-09 03:35:01 +02:00
greeter.proto Add a complete greeter example 2020-08-09 03:35:01 +02:00
README.md Add a complete greeter example 2020-08-09 03:35:01 +02:00
server.py Clean up example 2020-08-09 03:53:39 +02:00

example

What Is What

  • greeter.proto: human-written protobuf definition
  • greeter_grpc.py: machine-generated service code
  • greeter_pb2.py: machine-generated stub code
  • server.py: human-written server
  • client.py: human-written client code

Run It

$ pip install hrpc trio
$ python server.py  # terminal 1
$ python client.py  # terminal 2

Output:

Hello, World
Hello, 0
Hello, 1
Hello, 2
Hello, 3
Hello, 4