Quantcast
Channel: Apache Timeline
Viewing all articles
Browse latest Browse all 5648

general approach to streaming

$
0
0
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:

"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

Viewing all articles
Browse latest Browse all 5648

Trending Articles