3 ms·
> Never, ever use unbounded queues. In fact every unbounded asyncio.Queue() is a bug. It’s a serious API defect that asyncio allows unbounded queues to be creat
by qq11ww22ee33 6y ago
> Never, ever use unbounded queues. In fact every unbounded asyncio.Queue() is a bug. It’s a serious API defect that asyncio allows unbounded queues to be created at all.
asyncio is very poorly designed overall. This is just one offender.
> asyncio.sleep(0) is nearly always wrong.
This, however, is VERY bad advice. a sleep(0) (or, a checkpoint as it is better called) is very useful in things like branches where asynchronous operations only run in one branch. This ensures you don't end up deadlocking half your app if your branches go wrong.