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
Title: Add close method to queue
Type: Stage: resolved
Components: asyncio Versions: Python 3.10
process
Status: closed Resolution: later
Dependencies: Superseder:
Assigned To: Nosy List: asvetlov, eric.smith, heckad, remi.lapeyre, rhettinger, yselivanov
Priority: normal Keywords:

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) * Date: 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) Date: 2020-06-06 16:36
You should probably bring this up on the python-ideas mailing list.
msg371093 - (view) Author: Андрей Казанцев (heckad) * Date: 2020-06-09 11:49
How to do this?
msg371096 - (view) Author: Rémi Lapeyre (remi.lapeyre) * Date: 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) * Date: 2020-06-09 12:19
Thank you so much
msg371159 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2020-06-10 04:49
This can be re-opened if the discussion on the list warrants it.
History
Date User Action Args
2022-04-11 14:59:32adminsetgithub: 85065
2020-06-10 04:49:40rhettingersetstatus: open -> closed

nosy: + rhettinger
messages: + msg371159

resolution: later
stage: resolved
2020-06-09 12:19:28heckadsetmessages: + msg371097
2020-06-09 12:15:00remi.lapeyresetnosy: + remi.lapeyre
messages: + msg371096
2020-06-09 11:49:27heckadsettype: enhancement ->
messages: + msg371093
2020-06-06 16:36:08eric.smithsetversions: + Python 3.10
nosy: + eric.smith

messages: + msg370833

type: enhancement
2020-06-06 12:00:34heckadcreate