Skip to content

Instantly share code, notes, and snippets.

@marshallbrekka
Created May 10, 2017 17:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marshallbrekka/7dbc7e7eb65c5701149be2ab01b1a815 to your computer and use it in GitHub Desktop.
Save marshallbrekka/7dbc7e7eb65c5701149be2ab01b1a815 to your computer and use it in GitHub Desktop.
greeter_client.py
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