-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
Simplify consumers with iteration over *.Queue
#120947
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
Comments
Please keep discussions about alternatives in an unique issue, rather than opening one issue per alternative. I suggest to close this issue. |
Huh? That's what this is, it's a single issue to discuss the alternative solutions. |
I'm asking the opposite: discuss your alternative in the existing issue, don't create a new issue just for an alternative. |
OK, then I misunderstood this comment:
|
Uh oh!
There was an error while loading. Please reload this page.
Feature or enhancement
Proposal:
Currently consuming items from a queue can be a bit more complex than necessary. You need to
q.task_done()
after processing each itemBy allowing iteration over
*.Queue
, this becomes a bit easier, you only need to callqueue.shutdown()
.Has this already been discussed elsewhere?
No response given
Links to previous discussion of this feature:
asyncio.Queue.__aiter__
#119154queue.Queue
an iterable #120499*.Queue.iter()
and*.Queue.iter_nowait()
#120924Linked PRs
asyncio.Queue.__aiter__()
andqueue.Queue.__iter__()
asyncio.Queue
an asynchronous iterable #120491queue.Queue
an iterable #120503*.Queue.iter()
and*.Queue.iter_nowait()
*.Queue.iter()
and*.Queue.iter_nowait()
#120925The text was updated successfully, but these errors were encountered: