Accidentally responded off list.

On Tue, Jun 9, 2020 at 1:06 PM Андрей <> wrote:

Thank you for your comment.


This feature is very needed for


PS How to send response on this message? I don’t see this message on

You need to register on python's bug tracker if you want to be able to respond to the bug report there.

And where do you find RLock?

It's in the threading package. You can use a normal Lock, it's just that I needed to be able to call this from __del__ so I needed a lock that can be re-entered.


Отправлено из приложения "Почта" для Windows 10


От: Matthew Einhorn
Отправлено: 9 июня 2020 г. в 19:41
Кому: Kazantcev Andrey
Тема: Re: [Python-ideas] Add close method to queue


I was just looking for something similar, but this was already requested and rejected for lack of use cases here:


For my own use case, a RLock with a class variable indicating the queue was closed did the trick.


On Tue, Jun 9, 2020 at 8:25 AM Kazantcev Andrey <> wrote:

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.
Python-ideas mailing list --
To unsubscribe send an email to
Message archived at
Code of Conduct: