(self, resolve=False)
| 608 | self._timeout_handle.cancel() |
| 609 | |
| 610 | async def _wait_for_one(self, resolve=False): |
| 611 | # Wait for the next future to be done and return it unless resolve is |
| 612 | # set, in which case return either the result of the future or raise |
| 613 | # an exception. |
| 614 | f = await self._done.get() |
| 615 | if f is None: |
| 616 | # Dummy value from _handle_timeout(). |
| 617 | raise exceptions.TimeoutError |
| 618 | return f.result() if resolve else f |
| 619 | |
| 620 | |
| 621 | def as_completed(fs, *, timeout=None): |