Junyeong Jeong <[email protected]> added the comment:
Thanks for having an interest in this issue.
I thought asyncio.Queue guarantees the order of items as .put called after I
read the code. But it does not.
I attach poc code here.
In my machine, this program prints this message and exits.
$ python poc-oooput.py
num=1, last_read_num=0
num=33, last_read_num=1
Traceback (most recent call last):
File "poc-oooput.py", line 47, in <module>
asyncio.run(main())
File "/home/esrse/.pyenv/versions/3.7.3/lib/python3.7/asyncio/runners.py",
line 43, in run
return loop.run_until_complete(main)
File
"/home/esrse/.pyenv/versions/3.7.3/lib/python3.7/asyncio/base_events.py", line
584, in run_until_complete
return future.result()
File "poc-oooput.py", line 44, in main
await stream.read()
File "poc-oooput.py", line 20, in read
assert num == self._last_read_num + 1
AssertionError
This shows you that the 33rd item is put before the 2nd item.
----------
Added file: https://bugs.python.org/file48740/poc-oooput.py
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue38874>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com