[issue37334] Add a cancel method to asyncio Queues

Andrew Svetlov report at bugs.python.org
Thu Nov 21 15:02:32 EST 2019


Andrew Svetlov <andrew.svetlov at gmail.com> added the comment:

1. Suppose we have 2 concurrent producers, a single queue and a consumer.
2. The first producer puts several items into the queue and then calls q.close()
3. The second producer also puts several items. It doesn't matter the second producer closes the queue at the end or not.
4. The consumer gets items from the queue and prints them.

What items are printed and what are canceled/skipped? With the proposed PR it depends on timings of putting and getting data items and the queue size. 
The output can vary from zero to all pushed data.
That's why I think that the idea is not reliable.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37334>
_______________________________________


More information about the Python-bugs-list mailing list