-
-
Notifications
You must be signed in to change notification settings - Fork 34.2k
gh-119154: Simplify consumers by making asyncio.Queue an asynchronous iterable
#120491
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
Closed
Closed
Changes from all commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
e9c1a3e
Add `asyncio.Queue.__aiter__()`
nineteendo 3cd59ee
Reduce diff
nineteendo 16fc429
Add test
nineteendo f13ddb3
Simplify code
nineteendo afd7ad4
Add to `__all__`
nineteendo 214548c
📜🤖 Added by blurb_it.
blurb-it[bot] 9824b63
Simplify example
nineteendo 6358b8e
Fix indentation
nineteendo 316b800
Improve order
nineteendo 92f3295
Test `StopAsyncIteration`
nineteendo a18767d
Document `AsyncQueueIterator`
nineteendo 320691c
Apply suggestions from code review
nineteendo f43bdb1
Unpack for loop
nineteendo 4ca4a93
Insert newline
nineteendo fffacb2
Simplify example
nineteendo 92d7b16
Indent correctly
nineteendo ce23fce
Document `__aiter__()`
nineteendo 640d2a8
Fix indent attempt 1
nineteendo 6c9aa6d
Make `AsyncQueueIterator` private
nineteendo e6a5849
Use term
nineteendo 583f642
Re-order
nineteendo 1b6e781
Remove comment
nineteendo 2d5998a
Update whatsnew
nineteendo 841d50c
Update blurb
nineteendo d624bea
Apply suggestions from code review
nineteendo 0a8a72b
Update Doc/library/asyncio-queue.rst
nineteendo b3199df
Rename 2024-06-14-10-30-43.gh-issue-119154.1MHWA-.rst to 2024-06-14-1…
nineteendo d71eb91
Make queue a private attribute
nineteendo 23e37f4
Clarify behaviour
nineteendo 3bb4e65
Fix grammar
nineteendo 9eff835
Update 2024-06-14-10-30-43.gh-issue-119154.1MHWA-.rst
nineteendo 8580e98
Remove parentheses
nineteendo 670611f
Update Doc/whatsnew/3.14.rst
nineteendo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions
2
Misc/NEWS.d/next/Library/2024-06-14-10-30-43.gh-issue-119154.1MHWA-.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| Make :class:`asyncio.Queue` an :term:`asynchronous iterable`. | ||
| Contributed by Wannes Boeykens. |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm curious why you created a new class here as iterator instead of adding
__anext__to queue itself?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From #119154 (comment):