Skip to content

Instantly share code, notes, and snippets.

@ashish-mj
Created May 4, 2024 17:17
Show Gist options
  • Save ashish-mj/c077a3ed488d46cb8c9a2e1cd66a131c to your computer and use it in GitHub Desktop.
Save ashish-mj/c077a3ed488d46cb8c9a2e1cd66a131c to your computer and use it in GitHub Desktop.
import grpc
import helloworld_pb2
import helloworld_pb2_grpc
def run():
with grpc.insecure_channel("localhost:50051") as channel:
stub = helloworld_pb2_grpc.GreeterStub(channel)
response = stub.SayHello(helloworld_pb2.HelloRequest(name="World"))
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