-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
gh-96471: Add asyncio queue shutdown #104228
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
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
440a702
Add asyncio queue shutdown
EpicWink fb458db
Fix queue shutdown
YvesDup e5951ac
📜🤖 Added by blurb_it.
blurb-it[bot] a72aedd
Merge remote-tracking branch 'upstream/main' into asyncio-queue-shutdown
EpicWink d5e925d
Add references in docs and news entry
EpicWink f3517fb
Merge remote-tracking branch 'upstream/main' into asyncio-queue-shutdown
EpicWink bd2a7c3
Improve docs
EpicWink e9ac8de
Consume queue on immediate shutdown
EpicWink 1e7813a
Fix links in what's-new
EpicWink 1275bb6
Merge remote-tracking branch 'upstream/main' into asyncio-queue-shutdown
EpicWink eec29bb
Fix formatting in news entry
EpicWink 2c6156f
Merge remote-tracking branch 'upstream/main' into asyncio-queue-shutdown
EpicWink 17f1f32
Merge remote-tracking branch 'upstream/main' into asyncio-queue-shutdown
EpicWink a233830
Improve tests
EpicWink 420a247
Improve tests even more
EpicWink 25ad2ac
Merge remote-tracking branch 'upstream/main' into asyncio-queue-shutdown
EpicWink f3321b4
Merge remote-tracking branch 'upstream/main' into asyncio-queue-shutdown
EpicWink 6d9edd6
Document tests
EpicWink 1135d85
Merge remote-tracking branch 'upstream/main' into asyncio-queue-shutdown
EpicWink ddc6ad6
Always allow getters to re-check queue empty
EpicWink 2fa1bd9
Merge branch 'main' into asyncio-queue-shutdown
gvanrossum aef4063
Simplify shutdown-check in put and get
EpicWink d49c6dd
Format shutdown docstring
EpicWink 5a435a6
Check for 0 unfinised tasks in shutdown
EpicWink c8db40e
Use asyncio.sleep to run other tasks
EpicWink ca01ee1
Use public method to shut down queue in format test
EpicWink b02c4dd
Only start queue join after shutdown in test
EpicWink 8deca77
Test join before failing task-done
EpicWink 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
Improve docs
- Loading branch information
commit bd2a7c397d75a0297e01dbaf2b19c3d313204a1a
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -275,6 +275,10 @@ asyncio | |
forcefully close an asyncio server. | ||
(Contributed by Pierre Ossman in :gh:`113538`.) | ||
|
||
* Add :meth:`asyncio.queues.Queue.shutdown` (along with | ||
EpicWink marked this conversation as resolved.
Show resolved
Hide resolved
|
||
:exc:`asyncio.queues.QueueShutDown`) for queue termination. | ||
(Contributed by Laurie Opperman and Yves Duprat in :gh:`104228`.) | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We've worked well together, I'd be nice if you'd mention me. |
||
base64 | ||
--- | ||
|
||
|
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
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.
Sorry but I have a doubt, shouldn't this documentation block be rather:
In event of change, the docstring of the
shutdown
method must be updated.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.
join
callers aren't necessarily even unblocked anyway, if consumers are processing any items. I should probably say that a task is marked as done for each item in the queue if immediate shutdown.Also, I think the threading queue docs are the same.
Uh oh!
There was an error while loading. Please reload this page.
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.
It's very precise, better.
Yes, I commented here so as not to forget (see #117532 (comment)).
English is your native language, I think it'is best if you update documentations and docstrings.
Update: but I can create the follow-up PR.
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've made a PR: #117621