Skip to content

Instantly share code, notes, and snippets.

@riquellopes
Created March 4, 2019 03:02
Show Gist options
  • Save riquellopes/e571dbf7a1c1eaf1a93d26429999b968 to your computer and use it in GitHub Desktop.
Save riquellopes/e571dbf7a1c1eaf1a93d26429999b968 to your computer and use it in GitHub Desktop.
#! .venv/bin/python
# Simple client to connect a gRPC service to get information about the employee vacation.
import grpc
from protons.vacations_pb2 import VacationRequest
from protons.vacations_pb2_grpc import VacationServiceStub
def client():
with grpc.insecure_channel("localhost:50051") as dial:
client = VacationServiceStub(dial)
response = client.WhenDoYouStartYourVacation(
VacationRequest(name="Henrique Lopes"))
print("Response: " + response.reply)
if __name__ == "__main__":
client()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment