“Closing” a blocking queue

前端 未结 10 895
不思量自难忘°
不思量自难忘° 2021-01-30 09:13

I’m using java.util.concurrent.BlockingQueue in a very simple producer-consumer scenario. E.g. this pseudo code depicts the consumer part:

class QueueCo         


        
10条回答
  •  死守一世寂寞
    2021-01-30 10:05

    Is it possible to extend ComplexObject and mock out the non-trivial creation functionality? Essentially you're ending up with a shell object but you can do then do instance of to see if is the end of queue object.

提交回复
热议问题