Created
March 4, 2019 03:02
-
-
Save riquellopes/e571dbf7a1c1eaf1a93d26429999b968 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! .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