Skip to content

Instantly share code, notes, and snippets.

@rmsaitam
Last active January 30, 2024 11:16
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 rmsaitam/83c87588bd64cd3797800d704c8b64ab to your computer and use it in GitHub Desktop.
Save rmsaitam/83c87588bd64cd3797800d704c8b64ab to your computer and use it in GitHub Desktop.
Cliente GRPC
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