StephenCleary / AsyncEx

A helper library for async/await.
MIT License
3.49k stars 358 forks source link

Support AsyncProducerConsumerQueue wait for empty #263

Open WalkerCodeRanger opened 2 years ago

WalkerCodeRanger commented 2 years ago

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.