def METHOD_NAME(client, query_factory, chunk_size=10):
    entry_counter = tools.StreamEntryCounter()
    previous = None
    while True:
        origin = entry_counter.current()
        if previous == origin:
            break
        previous = origin
        q = query_factory(origin)
        for entry in client.query(q, chunk_size):
            entry_counter.update(entry)
            yield entry