Remix.run Logo
phs2501 4 hours ago

The one thing I wish stock python queues had an option for (async or otherwise) was some kind of explicit termination. e.g. be split into producers and consumers, and have consumers indicate iteration complete when all producers have finished (and vice versa - signal producers that all consumers have gone away). You can kind of kludge around it in one direction with stop sentinals but it's a lot more awkward to deal with - especially if your queues are bounded as then you can get into the situation where you block trying to push the stop sentinal onto the queue as it's full.

matheist 4 hours ago | parent [-]

Does task_done not do what you want?

https://docs.python.org/3/library/queue.html#queue.Queue.tas...