def store_and_broadcast(self, iterable): """iter完这个generator并且返回最后一个""" line = '' for line in iterable: rds.rpush(self.log_key, line) rds.publish(self.publish_key, line) return line
def store_and_broadcast(self, iterable): for line in iterable: rds.rpush(self.log_key, line) rds.publish(self.publish_key, line)