I'm searching if it's possible to use Java stream with queue/backpressure. Something like:
iterator -> (queue?) -> parallelstream -> map -> collector
Mapping is slower than iterator (even if multithreaded), so iterator should be read a slower pace (backpressure) or data from iterator should be queued to wait for mapping. I've found that reactive stream can be used for backpressure (https://blog.softwaremill.com/how-not-to-use-reactive-streams-in-java-9-7a39ea9c2cb3) but what about a queue?