Last active
January 30, 2024 11:16
-
-
Save rmsaitam/83c87588bd64cd3797800d704c8b64ab to your computer and use it in GitHub Desktop.
Cliente GRPC
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
import grpc | |
import examplo_pb2 | |
import examplo_pb2_grpc | |
def run_client(): | |
channel = grpc.insecure_channel("localhost:50051") | |
stub = examplo_pb2_grpc.GreeterStub(channel) | |
response = stub.SayHello(examplo_pb2.HelloRequest(name="gRPC")) | |
print("Greeter client received:", response.greeting) | |
if __name__ == "__main__": | |
run_client() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment