How luca5lima/grpc-calculator works
This is a small distributed calculator: a terminal user selects an operation and enters three numbers, the client builds a protobuf request and makes a unary gRPC call, and the server computes a result or reports division-by-zero before returning a response. The proto defines the RPC and message contract; generated Python bindings support both endpoints. README documents the HTTP/2 client-server exchange and generated-code relationship. The generated binding files are present in the tree but were not excerpted, so their internal behavior is not expanded here.
Main entry points: cliente.py Interactive client · servidor.py RPC server and operations · calculadora_pb2.py Message bindings · calculadora_pb2_grpc.py RPC bindings
Components 7
Client
- Interactive client
cliente.py
RPC contract
- Message bindings
calculadora_pb2.py - RPC bindings
calculadora_pb2_grpc.py - Calculator contract
calculadora.proto
Server
- RPC server and operations
servidor.py
Other components
- Terminal user
- gRPC over HTTP/2
Connections 11
- Terminal user → Interactive client: enters values
README.md - Interactive client → Message bindings: builds request
cliente.py - Interactive client → RPC bindings: calls stub
cliente.py - Interactive client → gRPC over HTTP/2: sends RPC
README.md - gRPC over HTTP/2 → RPC server and operations: routes RPC
README.md - RPC server and operations → Message bindings: builds response
servidor.py - RPC server and operations → RPC bindings: registers servicer
servidor.py - Calculator contract → Message bindings: defines messages
README.md - Calculator contract → RPC bindings: defines RPCs
README.md - RPC server and operations → gRPC over HTTP/2: serves calls
servidor.py - gRPC over HTTP/2 → Interactive client: returns result
README.md