This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
标题: Add close method to queue
类型: Stage: resolved
Components: asyncio Versions: Python 3.10
process
状态: closed Resolution: later
Dependencies: 后续:
分配给: 抄送列表: asvetlov, eric.smith, heckad, remi.lapeyre, rhettinger, yselivanov
优先级: normal 关键字:

Created on 2020-06-06 12:00 by heckad, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Messages (6)
msg370818 - (view) Author: Андрей Казанцев (heckad) * 日期: 2020-06-06 12:00
I have a problem with notifying all current subscribers and new subscribers about the closure of the queue and the reason. For example, I have a producer that reads messages from websocket or something else and send this to a queue, and several consumers (I do not know how many). If any exception occurred, then all current subscribers and subscribers which will be added later should know about this error. I tried to send an exception to a queue, but that did not help, because I have several consumers. Also, this will not protect new consumers. I propose to add a new close method with exc argument, which will throw an exception when calling the get method, and also throw an exception for all current _getters.
msg370833 - (view) Author: Eric V. Smith (eric.smith) * (Python committer) 日期: 2020-06-06 16:36
You should probably bring this up on the python-ideas mailing list.
msg371093 - (view) Author: Андрей Казанцев (heckad) * 日期: 2020-06-09 11:49
How to do this?
msg371096 - (view) Author: Rémi Lapeyre (remi.lapeyre) * 日期: 2020-06-09 12:15
The python-ideas is hosted at https://mail.python.org/mailman3/lists/python-ideas.python.org/, you can create an account and once it's validated you will be able to post a new message either using the web UI or by sending a mail directly to the list.
msg371097 - (view) Author: Андрей Казанцев (heckad) * 日期: 2020-06-09 12:19
Thank you so much
msg371159 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) 日期: 2020-06-10 04:49
This can be re-opened if the discussion on the list warrants it.
历史
日期 用户 动作 参数
2022-04-11 14:59:32admin修改github: 85065
2020-06-10 04:49:40rhettinger修改状态: open -> closed

抄送: + rhettinger
消息: + msg371159

resolution: later
stage: resolved
2020-06-09 12:19:28heckad修改消息: + msg371097
2020-06-09 12:15:00remi.lapeyre修改抄送: + remi.lapeyre
消息: + msg371096
2020-06-09 11:49:27heckad修改type: enhancement ->
消息: + msg371093
2020-06-06 16:36:08eric.smith修改versions: + Python 3.10
抄送: + eric.smith

消息: + msg370833

type: enhancement
2020-06-06 12:00:34heckad创建