The functor already can return a separate Iterable per-invocation, unless I misunderstood your comment?
To clarify, I meant, does the implementation of the http://doc.akka.io/japi/akka/current/akka/stream/javadsl/Flow.html#mapConcat-akka.japi.function.Function- stage ever need to obtain multiple iterators from the Iterable object returned from the functor passed into it? On Tuesday, September 26, 2017 at 10:36:08 PM UTC-7, Konrad Malawski wrote: > > > Are multiple iterators ever needed to be requested from it? > > I'm kind of tempted to do > Flow.<Iterator<T>>create().mapConcat(iter -> new Iterable<T>() { > @Override > public Iterator<T> iterator() > { > return iter; > }}).grouped(chunkSize).map(list -> list.iterator()) > > > That’s what “multiple materializations of the same stream pipeline” are, > so yes. > > If returning the same iterator is what you want there then feel free to do > so; It means though that if you start 2 streams using a part of that > mapConcat would end up accessing the same iterator potentially concurrently. > > — Konrad > -- >>>>>>>>>> Read the docs: http://akka.io/docs/ >>>>>>>>>> Check the FAQ: >>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user --- You received this message because you are subscribed to the Google Groups "Akka User List" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/akka-user. For more options, visit https://groups.google.com/d/optout.
