Skip to content

gh-77714: Provide an async iterator version of as_completed #22491

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 20 commits into from
Apr 1, 2024
Merged
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
5b14951
bpo-33533: Provide an async iterator version of as_completed
JustinTArthur Oct 1, 2020
f0f22f0
New docstring for revised async iteration pattern. Doc polish.
JustinTArthur Oct 4, 2020
27d546a
Remove internal callbacks on as_completed iterator deletion.
JustinTArthur Oct 4, 2020
c049b3a
Update docstring of concurrent test for revised async iterator shape
JustinTArthur Oct 4, 2020
8912149
Clarify TimeoutError source in as_completed docstring.
JustinTArthur Oct 4, 2020
ffde36a
Merge branch 'master' into async-for-as-completed
JustinTArthur Nov 6, 2020
397c3b3
Merge branch 'main' into async-for-as-completed
serhiy-storchaka Dec 19, 2023
f759fb4
Fix tests.
serhiy-storchaka Dec 20, 2023
c74a169
Update docs.
serhiy-storchaka Dec 20, 2023
a2b3b77
Avoid circular import problem.
serhiy-storchaka Dec 21, 2023
0915257
Small refactoring.
serhiy-storchaka Dec 21, 2023
9e6658a
Remove __del__ method which does not have effect.
serhiy-storchaka Dec 21, 2023
32ac402
Fix What's New/
serhiy-storchaka Dec 21, 2023
a6cdcf7
Doc and docstring changes following @gvanrossum review.
JustinTArthur Feb 10, 2024
40c13ad
Consistent quotation marks in examples.
JustinTArthur Feb 27, 2024
0e56f0b
Apply suggestions from code review.
JustinTArthur Feb 28, 2024
c4d84ab
Expand as_completed examples, clean _AsCompleted docstring salad.
JustinTArthur Feb 29, 2024
8863a55
Merge branch 'main' into async-for-as-completed
JustinTArthur Feb 29, 2024
378b69c
Import queues module at module-level of asyncio.tasks.
JustinTArthur Mar 1, 2024
0ba0b29
Merge branch 'main' into async-for-as-completed
JustinTArthur Apr 1, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Import queues module at module-level of asyncio.tasks.
  • Loading branch information
JustinTArthur committed Mar 1, 2024
commit 378b69cc136aa55efe2d2ba329ced706c1369b4c
4 changes: 2 additions & 2 deletions Lib/asyncio/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
from . import events
from . import exceptions
from . import futures
from . import queues
from . import timeouts

# Helper to generate new task names
Expand Down Expand Up @@ -572,8 +573,7 @@ class _AsCompletedIterator:
result of the next underlying future to complete.
"""
def __init__(self, aws, timeout):
from .queues import Queue # Import here to avoid circular import problem.
self._done = Queue()
self._done = queues.Queue()
self._timeout_handle = None

loop = events.get_event_loop()
Expand Down