class MessageIterator: def __init__(self): self.r = MessageReader() def __call__(self, buf): self.r.add_buffer(buf) while True: m = self.r.get_message() if not m: break yield m
def __init__(self): self.r = MessageReader()