response = udf_pb2.Response() response.point.CopyFrom(point) self._agent.write_response(response, True) def end_batch(self, end_req): raise Exception("not supported") class accepter(object): _count = 0 def accept(self, conn, addr): self._count += 1 a = Agent(conn, conn) h = MirrorHandler(a) a.handler = h logger.info("Starting Agent for connection %d", self._count) a.start() a.wait() logger.info("Agent finished connection %d", self._count) if __name__ == '__main__': path = "/tmp/mirror.sock" if len(sys.argv) == 2: path = sys.argv[1] server = Server(path, accepter()) logger.info("Started server") server.serve()
def point(self, point): response = udf_pb2.Response() response.point.CopyFrom(point) self._agent.write_response(response, True) def end_batch(self, end_req): raise Exception("not supported") class accepter(object): _count = 0 def accept(self, conn, addr): self._count += 1 a = Agent(conn, conn) h = MirrorHandler(a) a.handler = h logger.info("Starting Agent for connection %d", self._count) a.start() a.wait() logger.info("Agent finished connection %d",self._count) if __name__ == '__main__': path = "/tmp/mirror.sock" if len(sys.argv) == 2: path = sys.argv[1] server = Server(path, accepter()) logger.info("Started server") server.serve()