AsyncEx
AsyncEx copied to clipboard
Support AsyncProducerConsumerQueue wait for empty
The AsyncProducerConsumerQueue<T>.OutputAvailableAsync() available method allows you to wait until the output is available. However, there is no way to wait for the queue to be empty.
My use case is actually for unit tests. I need to wait until the consumer has processed everything in the queue before adding more items to the queue.