Called set the returned future's state that of the future we yielded, and set the current future for the iterator.
(self, done: Future)
| 411 | self._finished.append(done) |
| 412 | |
| 413 | def _return_result(self, done: Future) -> Future: |
| 414 | """Called set the returned future's state that of the future |
| 415 | we yielded, and set the current future for the iterator. |
| 416 | """ |
| 417 | if self._running_future is None: |
| 418 | raise Exception("no future is running") |
| 419 | chain_future(done, self._running_future) |
| 420 | |
| 421 | res = self._running_future |
| 422 | self._running_future = None |
| 423 | self.current_future = done |
| 424 | self.current_index = self._unfinished.pop(done) |
| 425 | |
| 426 | return res |
| 427 | |
| 428 | def __aiter__(self) -> typing.AsyncIterator: |
| 429 | return self |
no test coverage detected