And where do you find RLock?
Отправлено из приложения "Почта" для Windows 10
I was just looking for something similar, but this was already requested and rejected for lack of use cases here: https://bugs.python.org/issue29701.
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 <email@example.com> 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 -- firstname.lastname@example.org
To unsubscribe send an email to email@example.com
Message archived at https://firstname.lastname@example.org/message/EYVGOE5XUJPHKMDAGDHAXZ32VP6IAZL5/
Code of Conduct: http://python.org/psf/codeofconduct/