Created
January 26, 2018 14:23
-
-
Save markns/dd35f38d257f51255a8d82d86fb94813 to your computer and use it in GitHub Desktop.
grpc unary-stream client
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 | |
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