DEV Community

Discussion on: Streaming large queries in Java

Collapse
 
mcgowanb profile image
Brian McGowan

I found that the LinkedBlockingQueue fills up to whatever the limit is set to, say 100 in this example and then it throws a buffer overflow exception which is gracefully swallowed. Be nice if you could pop off the queue once you've consumed an element from the stream.

Collapse
 
chochos profile image
Enrique Zamudio

Not sure what you mean by poppin off the queue once the element's been consumed... queue.take() is called inside tryAdvance, which removes the first element from the queue and passes it to the stream's consumer...