GuillaumeFalourd / poc-grpc-python

POC of a gRPC project in Python 🐍

Home Page:https://grpc.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

gRPC (Google Remote Procedure Call) Python

This code's has been inspired from from the grpc.io site.

Run

Message

Message Execution

From the message directory:

Run the server:

python3 message_server.py

From another terminal window, run the client:

python3 message_client.py

Ritchie

Ritchie Premisse

  • Ritchie CLI installed locally
  • ritchie-formulas-demo Github repository imported:
rit add repo --provider="Github" --name="demo" --repoUrl="https://github.com/ZupIT/ritchie-formulas-demo" --priority=1

Ritchie Execution

From the python/ritchie directory:

Run the server:

python3 ritchie_server.py

From another terminal window, run the client:

python3 ritchie_client.py

Demo

Message Sample

Message inputs and response (client)

Client

Logs from message server

Server

Ritchie Sample

Ritchie inputs and response (client)

Client

Logs from ritchie server

Server

Update

Message RPC code

Updating the /protos/message.proto file, we need to update the gRPC code used by our application to use the new service definition.

From the message directory, run:

python3 -m grpc_tools.protoc -I../protos --python_out=. --grpc_python_out=. ../protos/message.proto

Ritchie RPC code

Updating the /protos/ritchie.proto file, we need to update the gRPC code used by our application to use the new service definition.

From the ritchie directory, run:

python3 -m grpc_tools.protoc -I../protos --python_out=. --grpc_python_out=. ../protos/ritchie.proto

About

POC of a gRPC project in Python 🐍

https://grpc.io/

License:Apache License 2.0


Languages

Language:Python 100.0%