I've got various cases where I have large number of results (POJOs) and want to stream them so that:
1. initial results are returned immediately
2. memory utilisation is kept under control

I was expecting to use something like using a BlockingQueue [1] but according to the Javadocs:

> A BlockingQueue does not intrinsically support any kind of "close" or "shutdown" operation to indicate that no more items will be added.

which seems to be essential and I can't find any obvious way to handle this.
Am I missing something obvious here?

[1] https://docs.oracle.com/javase/7/docs/api/java/util/concurrent/BlockingQueue.html


Tim

Reply via email to