def protobuf_stream_watch(filename): assert os.path.exists(filename) proc = subprocess.Popen( ['tail', '-f', '-c', '+0', filename], stdout=subprocess.PIPE) while True: yield protobuf_stream_read(proc.stdout)
def receive(self): response_string = protobuf_stream_read(self.proc.stdout) response = Query.Response() response.ParseFromString(response_string) return response
def call_string(self, request_string): protobuf_stream_write(request_string, self.proc.stdin) return protobuf_stream_read(self.proc.stdout)
def protobuf_stream_watch(filename): assert os.path.exists(filename) proc = subprocess.Popen(['tail', '-f', '-c', '+0', filename], stdout=subprocess.PIPE) while True: yield protobuf_stream_read(proc.stdout)