Skip to content

Instantly share code, notes, and snippets.

@markns
Created January 26, 2018 14:23
Show Gist options
  • Save markns/dd35f38d257f51255a8d82d86fb94813 to your computer and use it in GitHub Desktop.
Save markns/dd35f38d257f51255a8d82d86fb94813 to your computer and use it in GitHub Desktop.
grpc unary-stream client
import grpc
from gridarrow.api_v1.proto.api_pb2 import ApplicationStreamRequest
from gridarrow.api_v1.proto.api_pb2_grpc import StreamsStub
def run():
channel = grpc.insecure_channel('localhost:50051')
stub = StreamsStub(channel)
stream = stub.Application(ApplicationStreamRequest())
try:
for e in stream:
print(e)
except KeyboardInterrupt:
pass
if __name__ == "__main__":
run()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment