def METHOD_NAME(self, next_result, results, raise_exceptions):
    for i, value in self._fetch_results(raise_exceptions):
        if i == next_result:
            yield value
            next_result += 1
            while next_result in results:
                yield results.pop(next_result)
                next_result += 1
        else:
            results[i] = value