Created
September 8, 2022 07:50
-
-
Save wfng92/a036bf4c1c38e2dc65098610511063bc to your computer and use it in GitHub Desktop.
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
import logging | |
import os | |
import grpc | |
from protos import hello_pb2, hello_pb2_grpc | |
def run(): | |
with grpc.insecure_channel('localhost:50051') as channel: | |
stub = hello_pb2_grpc.GreeterStub(channel) | |
response = stub.SayHello(hello_pb2.HelloRequest(name='John Doe', age=30)) | |
print("Greeter client received: " + response.message) | |
if __name__ == '__main__': | |
logging.basicConfig() | |
run() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment