This is a part of custom search command (EventingCommand) fro example. I get some input events and start jobs based on them.
def transform(self, events):
event = events.next()
search = getSearchFromEvent(event)
job = self.service.jobs.create(search)
while not job.is_done():
reader = results.ResultsReader(job.results(count = 0))
for line in reader:
Is it possible to skip iteration and return results as generator or something like without this circle?