Created
May 10, 2017 17:24
-
-
Save marshallbrekka/7dbc7e7eb65c5701149be2ab01b1a815 to your computer and use it in GitHub Desktop.
greeter_client.py
This file contains hidden or 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
from __future__ import print_function | |
import grpc | |
import time | |
import helloworld_pb2 | |
import helloworld_pb2_grpc | |
def run(): | |
channel = grpc.insecure_channel('localhost:50051') | |
time.sleep(15) | |
stub = helloworld_pb2_grpc.GreeterStub(channel) | |
response = stub.SayHello(helloworld_pb2.HelloRequest(name='you')) | |
print("Greeter client received: " + response.message) | |
time.sleep(15) | |
response = stub.SayHello(helloworld_pb2.HelloRequest(name='you')) | |
print("Greeter client received: " + response.message) | |
if __name__ == '__main__': | |
run() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment