Пример #1
0
 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
Пример #2
0
 def store_and_broadcast(self, iterable):
     for line in iterable:
         rds.rpush(self.log_key, line)
         rds.publish(self.publish_key, line)